Function calling in RoR

i m new in RoR…I have created a function in my controller
def create_by

.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…

u can call like
<%= link_to “Name” controller_path %>

or in other words

:link_to, :controller => ‘controllername’, :action =>

controller functions dont accept arguments. so calling your function
like link_to _created_by ‘name’ is wrong for several reasons:

  1. you misspelled your function name _create_by instead of create_by
  2. you passed name as an argument (you should use params)


On Jul 4, 8:08 am, “bala kishore pulicherla” [email protected]

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