Rails: i would need to load a haml file in a class and render in the caller
- by Totty
I have this:
app/modules/grid_module.rb
app/modules/grid.html.haml
then in my view:
app/views/layouts/default.html.haml
I want to make a new instance of the grid_module and render it content. Its content is into the grid.html.haml and this file can only use the instance vars set in the grid_module.rb
is this possible to do? (the grid name is just an example, it must be more flexible, to load the html.haml file based on the .rb class)
the grid_module must has access to models too*
like this: User.find_by_id(4)
thanks for help