On 24 April 2011 06:45, amrit pal pathak <[email protected]> wrote:
>
>
> On Apr 23, 12:11 pm, Frederick Cheung <[email protected]>
> wrote:
>> On Apr 23, 5:04 pm, amrit pal pathak <[email protected]>
>> wrote:> On Apr 23, 11:58 am, Colin Law <[email protected]> wrote:> On 
>> 23 April 2011 16:48, amrit pal pathak <[email protected]> wrote:
>>
>> > > And the result from rake routes?  You did try that didn't you?
>>
>> >        i did it gives
>>
>> >   click_fun GET /click/fun(.:format)
>> > {:action=>"fun", :controller=>"click"}
>> > home_index GET /home/index(.:format)
>> > {:action=>"index", :controller=>"home"}
>> >       root     /(.:format)
>> > {:action=>"index", :controller=>"home"}
>>
>> This means that the URL helpers that exist are click_fun_path,
>> home_index_path and root_path.
>> You can use clicks_path because it doesn't exist.
>
>        It was path syntax error.Now i used
>       "<%=link_to 'Submit',click_fun_path %>"          and it worked.
>         please tell me one thing ,click_fun_path is path to click
> controller or click view??

As I suggested previously it would be worth your while reading up on
MVC architecture, as it is fundamental to Rails apps.  There is no
such thing as a link to a view, links are always to controller
actions.  Also as pointed out previously you can see that from the
output of rake routes that you posted:
click_fun GET /click/fun(.:format) {:action=>"fun", :controller=>"click"}
That says that click_fun_path is a route with url click/fun (with
optional format) which will run controller click, action fun.

Colin

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to