Shared partial working with controller

Hi guys,

iam just wondering, can i use a shared partial with a controller? In
my project, i have in my views folder, a shared_partials folder where
i put my partials. In my controller eg books_controller i make a
search @books= Books.find(:all) and i want to show the results in the
partial using the for loop book @books etc . Allthouh this works when
i am in the controller views, when i am in the shared_partials views
does not works.

Any suggestions?
Thanx
Kostas L.

Hi
Can’t you use like

render :partial => “shared/partial_name”, :locals => {:books => @books}

Sijo

Thanx Sijo that worked! I’ve really forgotten :locals usage!!!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs