Rails: i would need to load a haml file in a class and render in the caller

Posted by Totty on Stack Overflow See other posts from Stack Overflow or by Totty
Published on 2010-05-13T19:46:52Z Indexed on 2010/05/15 22:20 UTC
Read the original article Hit count: 164

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about haml