Eric Gross
2006-Sep-27 02:05 UTC
problems with accessing controllers in sub tree directory
Hey guys, I used "script/generate controller admin/event" How do I link to the views and the controller when it''s inside a directory. I tried <%= link_to "some link", :controller=>"event",:action=>"index" %> <%= link_to "some link", :controller=>"admin/event",:action=>"index" %> <%= link_to "some link", :controller=>"admin",:action=>"index" %> <%= link_to "some link", :controller=>"event",:action=>"event/index" %> NOTHING seems to work. Any ideas? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Joe Ruby MUDCRAP-CE
2006-Sep-27 02:38 UTC
Re: problems with accessing controllers in sub tree director
Try putting a slash in front of the controller param: <%= link_to "some link", :controller=>"/admin/event",:action=>"index" %> Joe -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Vishnu Gopal
2006-Sep-27 06:26 UTC
Re: problems with accessing controllers in sub tree directory
What about <%= link_to "some link", :controller=>"/admin/event", :action=>"index" %> ? Vish On 9/27/06, Eric Gross <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hey guys, > > I used "script/generate controller admin/event" > > How do I link to the views and the controller when it''s inside a > directory. > > I tried > > <%= link_to "some link", :controller=>"event",:action=>"index" %> > > <%= link_to "some link", :controller=>"admin/event",:action=>"index" %> > > <%= link_to "some link", :controller=>"admin",:action=>"index" %> > > <%= link_to "some link", :controller=>"event",:action=>"event/index" %> > > NOTHING seems to work. > > Any ideas? > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Eric Gross
2006-Sep-27 10:51 UTC
Re: problems with accessing controllers in sub tree director
Hey guys, I tried this as well. No luck either. Its weird because when I put that in, the URL is www.mydomain.com/admin/event and the page is blank, even though there is content in the index.rhtml file. Does this work for you guys? Vishnu Gopal wrote:> What about > > <%= link_to "some link", :controller=>"/admin/event", :action=>"index" > %> > > ? > > Vish-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Eric Gross
2006-Sep-27 15:44 UTC
Re: problems with accessing controllers in sub tree director
Do I have to change something in my routing file to handle these nested controllers? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Vishnu Gopal
2006-Sep-27 17:36 UTC
Re: problems with accessing controllers in sub tree director
Probably. Why do you have nested controllers? Try map.connect ''admin/event/:action'', :controller => ''event'' Vish On 9/27/06, Eric Gross <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Do I have to change something in my routing file to handle these nested > controllers? > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ashley Thomas
2006-Sep-28 13:29 UTC
Re: problems with accessing controllers in sub tree director
Eric Gross wrote:> Hey guys, I tried this as well. No luck either. Its weird because when I > put that in, the URL is www.mydomain.com/admin/event and the page is > blank, even though there is content in the index.rhtml file.It works for me. If the URL is orrect and the page is blank, not an error, then it''s not a routing problem. Make sure your index.rhtml is in views/admin/event/. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Eric Gross
2006-Sep-28 16:32 UTC
Re: problems with accessing controllers in sub tree director
Hmm, well, the thing is, I did have an index.rhtml file and even if I didn''t, I should have gotten and error, or my layout should have rendered. How are you writing out your routing, is it www.mysite.com/admin/event/ and that would render the index.rhtml file in the views/admin/event directory? Ashley Thomas wrote:> Eric Gross wrote: >> Hey guys, I tried this as well. No luck either. Its weird because when I >> put that in, the URL is www.mydomain.com/admin/event and the page is >> blank, even though there is content in the index.rhtml file. > > It works for me. If the URL is orrect and the page is blank, not an > error, then it''s not a routing problem. Make sure your index.rhtml is in > views/admin/event/.-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---