Hi all, I''m trying to convert what I think are some pretty straight forward Rail2 routes to Rails3 routes with no success. I have map.connect '''', :controller => "agency" which I have tried converting to match '''', :to => ''agency'' which then throws an error saying: /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:183:in `default_controller_and_action'': missing :action (ArgumentError) from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:76:in `normalize_options!'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:59:in `initialize'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `new'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `add_route'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1282:in `decomposed_match'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `match'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `each'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `match'' from /home/shandy/npower/config/routes.rb:74 from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `instance_exec'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `eval_block'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:254:in `draw'' from /home/shandy/npower/config/routes.rb:1 from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `each'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:16:in `reload!'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:26:in `updater'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `call'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `execute'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:27:in `updater'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/finisher.rb:66 from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `run_initializers'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `send'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'' from /home/shandy/npower/config/environment.rb:5 from /home/shandy/npower/config.ru:4:in `require'' from /home/shandy/npower/config.ru:4 from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'' from /home/shandy/npower/config.ru:1:in `new'' from /home/shandy/npower/config.ru:1 I have also tried Npower::Application.routes.draw do match ''login'', :to => ''agency'' end But then I get an error that says "No route matches [GET] "/agency"." If anybody has any ideas or could point me to a site that explains the differences/conversions of Rails2 routes to Rails3 routes, that would much appreciated. Thanks, -S -- 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 https://groups.google.com/groups/opt_out.
On 19 July 2012 17:19, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi all, > > I''m trying to convert what I think are some pretty straight forward > Rail2 routes to Rails3 routes with no success. > > I have map.connect '''', :controller => "agency" which I have tried > converting to match '''', :to => ''agency'' which then throws an error > saying:Is that not just root :to => "agency#index" assuming the action you want is index. Unless I have forgotten how rails 2 routing worked. 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 https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1069377:> On 19 July 2012 17:19, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Is that not just > root :to => "agency#index" > assuming the action you want is index. Unless I have forgotten how > rails 2 routing worked. > > ColinThat''s what I thought, but I keep getting "No route matches [GET] "/agency/login"" error, so I''m wonder if I have something else setup incorrectly. Thanks for the response, -S -- 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 https://groups.google.com/groups/opt_out.
On 20 July 2012 16:24, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #1069377: >> On 19 July 2012 17:19, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >> Is that not just >> root :to => "agency#index" >> assuming the action you want is index. Unless I have forgotten how >> rails 2 routing worked. >> >> Colin > > That''s what I thought, but I keep getting "No route matches [GET] > "/agency/login"" error, so I''m wonder if I have something else setup > incorrectly. Thanks for the response,What url are you using that gives 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 https://groups.google.com/groups/opt_out.
Hey Shandy, use match '''', :to => ''agency#index'' or replace index with another agency controller action explicitly. In order to solve the second problem we''d need your routes.rb file (please use pastie.org or simple code formatting to make it easy to read. 2012/7/20 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>> On 20 July 2012 16:24, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Colin Law wrote in post #1069377: > >> On 19 July 2012 17:19, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> > >> Is that not just > >> root :to => "agency#index" > >> assuming the action you want is index. Unless I have forgotten how > >> rails 2 routing worked. > >> > >> Colin > > > > That''s what I thought, but I keep getting "No route matches [GET] > > "/agency/login"" error, so I''m wonder if I have something else setup > > incorrectly. Thanks for the response, > > What url are you using that gives 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 https://groups.google.com/groups/opt_out. > >-- 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 https://groups.google.com/groups/opt_out.
On 20 July 2012 17:44, Gintautas Šimkus <dihitales-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey Shandy, use > > match '''', :to => ''agency#index''Is that better then root :to=>... ? Colin> > or replace index with another agency controller action explicitly. > > In order to solve the second problem we''d need your routes.rb file (please > use pastie.org or simple code formatting to make it easy to read. > > 2012/7/20 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> >> >> On 20 July 2012 16:24, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> > Colin Law wrote in post #1069377: >> >> On 19 July 2012 17:19, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >> >> >> Is that not just >> >> root :to => "agency#index" >> >> assuming the action you want is index. Unless I have forgotten how >> >> rails 2 routing worked. >> >> >> >> Colin >> > >> > That''s what I thought, but I keep getting "No route matches [GET] >> > "/agency/login"" error, so I''m wonder if I have something else setup >> > incorrectly. Thanks for the response, >> >> What url are you using that gives 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 https://groups.google.com/groups/opt_out. >> > -- > 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 https://groups.google.com/groups/opt_out. > >-- 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 https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1069541:> On 20 July 2012 17:44, Gintautas Šimkus <dihitales-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hey Shandy, use >> >> match '''', :to => ''agency#index'' > > Is that better then root :to=>... ? > > ColinWhen I do that I get this error: syntax error, unexpected '':'', expecting kEND (SyntaxError) match '''' :to => ''agency#index'' ^ I''m not sure if I have some issue with my rails setup, but it seems like everything I try it either doesn''t work as expected, or errors when I stat the server. I''m running rails 3.2.2. Thanks for the suggestion, -S -- 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@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On 20 July 2012 21:38, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #1069541: >> On 20 July 2012 17:44, Gintautas Šimkus <dihitales-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> Hey Shandy, use >>> >>> match '''', :to => ''agency#index'' >> >> Is that better then root :to=>... ? >> >> Colin > > When I do that I get this error: > > syntax error, unexpected '':'', expecting kEND (SyntaxError) > match '''' :to => ''agency#index'' > ^ > > I''m not sure if I have some issue with my rails setup, but it seems like > everything I try it either doesn''t work as expected, or errors when I > stat > the server. I''m running rails 3.2.2. Thanks for the suggestion,So what happens with root :to? Show us the exact line you have in routes.rb, what url you are asking for and what happens. 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@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1069548:> On 20 July 2012 21:38, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > So what happens with root :to? > Show us the exact line you have in routes.rb, what url you are asking > for and what happens. > > ColinThat works fine, in that the server starts. I''m still unable to bring up a specific page. I get: No route matches [GET] "/agency/login" -S -- 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 https://groups.google.com/groups/opt_out.
On 20 July 2012 22:02, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #1069548: >> On 20 July 2012 21:38, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >> So what happens with root :to? >> Show us the exact line you have in routes.rb, what url you are asking >> for and what happens. >> >> Colin > > That works fine, in that the server starts. I''m still unable to bring up > a specific page. I get: No route matches [GET] "/agency/login"You still have not told us what url you are asking for when that happens, and exactly what you have specified for root :to=> 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 https://groups.google.com/groups/opt_out.
> > i also have the same problem.. > i use this coding: > match ''pages/:id/show2'' => ''pages#show2'', as: ''shows'' > > the result, i can only generate for url or path used.. for example .. <%= > link_to ''show2'', shows_path(page) %> > and the url > i also try to use this: > root to: ''pages#show'', as: ''store'' > it just for the 1st page, to redirect from localhost:3000 to that page.. n > ''store'' for url or path used only.. > > just to clarify, i''m trying to simplify the url from > localhost:3000/pages/:id/show to localhost:300/shows > > do anyone know the right way?? > >-- 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 To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/L-0yTpWQWAwJ. For more options, visit https://groups.google.com/groups/opt_out.
On 20 July 2012 22:12, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 20 July 2012 22:02, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> Colin Law wrote in post #1069548: >>> On 20 July 2012 21:38, Shandy Nantz <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> >>> So what happens with root :to? >>> Show us the exact line you have in routes.rb, what url you are asking >>> for and what happens. >>> >>> Colin >> >> That works fine, in that the server starts. I''m still unable to bring up >> a specific page. I get: No route matches [GET] "/agency/login" > > You still have not told us what url you are asking for when that > happens, and exactly what you have specified for root :to=>It is rather depressing how often this happens. A question is asked but the OP never responds. Presumably the OP realised his mistake in the process of answering the question but does not have the good manners to reply. :( Colin> > 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 https://groups.google.com/groups/opt_out.