Re: function calling in RoR

\"Wolas!\"
Fri, 04 Jul 2008 08:23:02 -0000

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:

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

j

On Jul 4, 8:08 am, "bala kishore pulicherla"
<balumc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> :o
> u can call like
> <%= link_to "Name" controller_path %>
>
> On Fri, Jul 4, 2008 at 12:13 PM, jokrish
<jollykrishn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > 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...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com