On Apr 23, 10:11 am, Colin Law <[email protected]> wrote:
> On 23 April 2011 13:40, amrit pal pathak <[email protected]> wrote:
>
>
>
>
>
>
>
>
>
>
>
> > On Apr 23, 8:26 am, Colin Law <[email protected]> wrote:
> >> On 23 April 2011 13:18, amrit pal pathak <[email protected]> wrote:
>
> >> > I generated a simple controller using "script/generate controller form
> >> > myfun".Then edited a /app/view/form/myfun.html.erb  simply as
> >> >  <h1>Hello</h1>
> >> > <%=link_to 'Submit'%>
>
> >> >                                               I created a another
> >> > controller using "script/generate controller click fun".Edited the app/
> >> > view/click/fun.html.erb to hold a welcome message as
>
> >> > <h1>Welcome</h1>
> >> >                                                      I want click on
> >> > submit should show this message,but dont know how to connect these two
> >> > controllers.using rails .I am using rails 3.0.7.
>
> >> It is important to distinguish between the three components Model View
> >> Controller of MVC design.  If you are not clear on these then some
> >> googling and reading might be worthwhile.  I presume that what you
> >> actually want to do is link to a controller action from the _view_ of
> >> another controller.  To do that simply put use link_to to link to the
> >> the controller/action that you want.
> >            I add the link to click controller(it has a fun action)
>
> You are confusing controller and view again, you cannot add a link to
> a controller, only to a view.
>
> > as ,but i gave error(may be a syntax error in specifying a controller
> > path).
> > <h1>Hello</h1>
> > <%=link_to 'Submit',click_path%>
>
> That should probably be clicks_path (plural).  
           Now i gave plural ,again error
    <h1>Hello</h1>
   <%=link_to 'Submit',clicks_path %>

Error is
undefined local variable or method `clicks_path' for #<#<Class:
0xb66b347c>:0xb66b1fa0>

Thanks


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