ruby - Rails possible function arguments -


i'm quite new rails , want improve workflow. i'd know can possible function parameters general rails functions. e.g:

i want use render function. arguments can pass it?

in order answer question went api.rubyonrails.org. tells me function signature:

render(*args, &block)

and don't more before.

to more information read through ruby on rails guide layouts , rendering (which great). if found looking it's not acceptable way possible options. i'm searching more concise.

how know can pass in things :partial or :layout function?

looking through actual source code option. that's not handy.

this render function example. occurred me in several places wanted use function , couldn't find documentation of capable of doing.

you can pass partial name want render argument follows :

<%= render :partial => 'partial_name' %> 

or can pass params follows :

<%= render :partial => 'users', :collection => @users, :locals => {:size => 30} %> 

hope helps.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -