i m new in RoR…I have created a function in my controller
def create_by
…
end
.how can i call this one by using a link …ie from my view this
function should be called when clicking on some field like name…
so in my index how can i call this function using a link
.
<%= link_to _created_by ‘name’ %> | …
i have used this…but getting errors…can anybody help me…
:o
u can call like
<%= link_to “Name” controller_path %>
or in other words
:link_to model.name, :controller => ‘controllername’, :action =>
‘create_by’
controller functions dont accept arguments. so calling your function
like link_to _created_by ‘name’ is wrong for several reasons:
- you misspelled your function name _create_by instead of create_by
- you passed name as an argument (you should use params)
j
On Jul 4, 8:08 am, “bala kishore pulicherla” [email protected]