ruby - How to convert html pages into erb in Rails? -


i have been given task convert static html pages erb pages, used in rails project. since pages belong same project, having common "application.html.erb" file. html pages have different class names <body> tag. , since have common "application.html.erb" file. how convert such html pages different names <body> tag , .erb files?

i instance variable, expected set in controller.

<body class="<%= @body_class %>"> 

you can set on per-controller or per-action basis. if there "formula" decide is, based on controller , action, via single before_filter defined in applicationcontroller.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -