Hello, I''m using Rails 3 and when I run this command: rails generate controller Todos2 So I get new controller called Todos2 and in file todos2_controller.rb I will creating two view, index and about. (+ of course I''ll creating appropriately views *.rhtml). Then when I type localhost:3000/todos - problem with routing, localhost:3000/todos/index - the same, localhost:3000/todos/about - the same When I used Rails v2.3.4, I rebooted server and everything worked. But now, I''m using Rails 3 and unfortunately nothing. And so: when creating controller and I''m typing: rails generate controller Todos2 index2, about2 So both of views are created automatically and it seems work. So I would like to ask you -- in Rails 3 is not possible to create views manually, only with using command? Thanks a lot, M. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 5, 10:53 am, Manny 777 <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hello, > I''m using Rails 3 and when I run this command: > > rails generate controller Todos2 > > So I get new controller called Todos2 and in file todos2_controller.rb I > will creating two view, index and about. (+ of course I''ll creating > appropriately views *.rhtml). Then when I type localhost:3000/todos - > problem with routing, localhost:3000/todos/index - the same, > localhost:3000/todos/about - the same > > When I used Rails v2.3.4, I rebooted server and everything worked. But > now, I''m using Rails 3 and unfortunately nothing. > > And so: when creating controller and I''m typing: > > rails generate controller Todos2 index2, about2 > > So both of views are created automatically and it seems work. > > So I would like to ask you -- in Rails 3 is not possible to create views > manually, only with using command?Probably because in a newly created rails 3 app the legacy default routes aren''t enabled by default. Looks like the generator will setup the routes for you but if you''re adding the extra actions yourself then you''ll have to add them to your routes file too. Fred> > Thanks a lot, > M. > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
And where this set up can I to find? I see into the files in config directory but I''m not sure, what I have to change... :/ -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 March 2011 12:33, Manny 777 <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> And where this set up can I to find? I see into the files in config > directory but I''m not sure, what I have to change... :/Have a look at the Rails Guide on routing. Also the guide on Getting Started probably. The free online tutorial at railstutorial.org will help to get you going also. Work right through that. 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hm... now I tried to create manually new action with view on new app and everything works... RoR kidding me! For the others: except the creating action and view, you must the add adequate line to config/routes.rb. Then it should work. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 March 2011 13:49, Manny 777 <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hm... now I tried to create manually new action with view on new app and > everything works... RoR kidding me!No action will work unless there is an appropriate entry in routes.rb. In the console type rake routes to see what routes are currently configured. If you still think that an action is being performed without a route then post routes.rb here and the url that you think is being routed without an entry. 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.