Skip to content

Instantly share code, notes, and snippets.

// Server Side Rendering based on routes matched by React-router.
app.use((req, res) => {
match({ routes, location: req.url }, (err, redirectLocation, renderProps) => {
if (err) {
return res.status(500).end('Internal server error');
}
if (!renderProps) {
return res.status(404).end('Not found!');
}
@prank7
prank7 / Gemfile
Created March 25, 2015 05:05
Integrating Bootstrap into Ruby On Rails
# In Gemfile, add the following line to specify 'bootstrap-sass' gem. I am using version 3.2.0.0.
gem 'bootstrap-sass', '3.2.0.0'
# After adding this line, install this gem by runing this command in your terminal- "bundle install"
# Now we have the gem installed. We need to add this to our asset pipeline in order to use bootstrap. To do so, create a new file in
# app/assets/stylesheets/ folder named "custom.css.scss", Or you can also rename "application.css" to "application.css.scss".
# see the next file in gist named "custom.css.scss" to see what goes there.