Hi All, I am new to Rails. I installed rails 3.2.13. Have Ruby ver. 1.9.2p20. I created a very simple rails example as follows. 1. Created rails app called "chart" 2. Generated a controller called - "draw" that has the following lines of code. It has a action called "load" which has no code in it. class DrawController < ApplicationController def load end end 3. I then navigated to following directory to create a view template of extension - .rhtml C:\rails\chart\app\views\draw\ 4. I start Webrick and hit URL - "http://localhost:3000/draw/load" I get the following error: No route matches [GET] "/draw/load" Try running rake routes for more information on available routes. The above example is most basic i suppose and should work. The .rhtml page just has plain html. Can someone please tell me what could be the issue. I remember this worked fine with previous rails version. Has anything changed? Help much appreciated. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/79820d7d6ba96117bd1b0b929cc80e44%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote:> > Hi All, > > I am new to Rails. I installed rails 3.2.13. Have Ruby ver. 1.9.2p20. > I created a very simple rails example as follows. > > 1. Created rails app called "chart" > 2. Generated a controller called - "draw" that has the following lines > of code. It has a action called "load" which has no code in it. > class DrawController < ApplicationController > def load > end > end > 3. I then navigated to following directory to create a view template of > extension - .rhtml > C:\rails\chart\app\views\draw\ > 4. I start Webrick and hit URL - "http://localhost:3000/draw/load" > > I get the following error: > No route matches [GET] "/draw/load" > Try running rake routes for more information on available routes. > > The above example is most basic i suppose and should work. The .rhtml > page just has plain html. > > Can someone please tell me what could be the issue. I remember this > worked fine with previous rails version. Has anything changed? > > Help much appreciated. > > -- > Posted via http://www.ruby-forum.com/. >You need to configure the route in the config/routes.db file. In this case, get ''draw#load'' -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/595007db-46ae-4adb-830a-7d7ebba4f687%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
mike wrote in post #1109637:> On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote: >> def load >> >> > You need to configure the route in the config/routes.db file. In this > case, > > get ''draw#load''Hi Mike. Thanks for response. So in this case i would need to do addition in Routes.rb for each controller/action.? Is there no rule that can be set In routes.rb? -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0619f40ec6aac3e3c353e3c9b45ecc17%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Hassan Schroeder
2013-May-20 19:44 UTC
Re: Re: Help needed - No route matches [GET] "/draw/load"
On Mon, May 20, 2013 at 12:20 PM, Rochit Sen <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> So in this case i would need to do > addition in > Routes.rb for each controller/action.? Is there no rule that can be set > In routes.rb?Recommended reading: http://guides.rubyonrails.org/routing.html -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 20 May 2013 20:44, Hassan Schroeder <hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Mon, May 20, 2013 at 12:20 PM, Rochit Sen <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> So in this case i would need to do >> addition in >> Routes.rb for each controller/action.? Is there no rule that can be set >> In routes.rb? > > Recommended reading: http://guides.rubyonrails.org/routing.htmlAnd all the other guides in fact, there are a number of changes since Rails 2. It might be worth skimming through the tutorial at railstutorial.org (which is free to use online) to see how much has changed. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Rochit Sen wrote in post #1109638:> mike wrote in post #1109637: >> On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote: >>> def load >>> >>> >> You need to configure the route in the config/routes.db file. In this >> case, >> >> get ''draw#load'' > > Hi Mike. Thanks for response. So in this case i would need to do > addition in > Routes.rb for each controller/action.? Is there no rule that can be set > In routes.rb?Hi All, I looked at the guide and also entered: get ''draw#load'' This is still not working. Can someone please send me a working example or try similar thing themselves. I am really stuck on this. thanks -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/475f527f0547026183df988fa6283950%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
tamouse mailing lists
2013-May-21 05:35 UTC
Re: Re: Help needed - No route matches [GET] "/draw/load"
On Tue, May 21, 2013 at 12:01 AM, Rochit Sen <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Rochit Sen wrote in post #1109638: >> mike wrote in post #1109637: >>> On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote: >>>> def load >>>> >>>> >>> You need to configure the route in the config/routes.db file. In this >>> case, >>> >>> get ''draw#load'' >> >> Hi Mike. Thanks for response. So in this case i would need to do >> addition in >> Routes.rb for each controller/action.? Is there no rule that can be set >> In routes.rb? > > Hi All, > > I looked at the guide and also entered: > get ''draw#load'' > This is still not working. Can someone please send me a working example > or try similar thing themselves. I am really stuck on this.Maybe try: match ''draw/load'' => ''draw#load'' instead? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t9%2B1pn_8FioZFCCRw4hVCHuqDurEWjpw37Ju1UCBDdTbg%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
On Tuesday, May 21, 2013 1:35:37 AM UTC-4, tamouse wrote:> > On Tue, May 21, 2013 at 12:01 AM, Rochit Sen <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org<javascript:>> > wrote: > > Rochit Sen wrote in post #1109638: > >> mike wrote in post #1109637: > >>> On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote: > >>>> def load > >>>> > >>>> > >>> You need to configure the route in the config/routes.db file. In this > >>> case, > >>> > >>> get ''draw#load'' > >> > >> Hi Mike. Thanks for response. So in this case i would need to do > >> addition in > >> Routes.rb for each controller/action.? Is there no rule that can be set > >> In routes.rb? > > > > Hi All, > > > > I looked at the guide and also entered: > > get ''draw#load'' > > This is still not working. Can someone please send me a working example > > or try similar thing themselves. I am really stuck on this. > > Maybe try: > > match ''draw/load'' => ''draw#load'' > > instead? >sorry, I missed something. no rhtml files. View files end in html.erb (for embedded ruby/html) or haml. the above match statement should work. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f2a42a2f-9805-42e6-a9c5-9fd77ea856be%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
On Tuesday, May 21, 2013 1:35:37 AM UTC-4, tamouse wrote:> > On Tue, May 21, 2013 at 12:01 AM, Rochit Sen <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org<javascript:>> > wrote: > > Rochit Sen wrote in post #1109638: > >> mike wrote in post #1109637: > >>> On Monday, May 20, 2013 1:26:20 PM UTC-4, Ruby-Forum.com User wrote: > >>>> def load > >>>> > >>>> > >>> You need to configure the route in the config/routes.db file. In this > >>> case, > >>> > >>> get ''draw#load'' > >> > >> Hi Mike. Thanks for response. So in this case i would need to do > >> addition in > >> Routes.rb for each controller/action.? Is there no rule that can be set > >> In routes.rb? > > > > Hi All, > > > > I looked at the guide and also entered: > > get ''draw#load'' > > This is still not working. Can someone please send me a working example > > or try similar thing themselves. I am really stuck on this. > > Maybe try: > > match ''draw/load'' => ''draw#load'' > > instead? >I missed something in your original post. The above match statement should work with 3.2 for routing, but your view file needs to end in html.erb for embedded ruby, or haml. rhtml isn''t recognized. I also echo Colin''s post, there''s a lot that has changed with Rails and spending some time with a decent tutorial and/or the edge guides would ease the transition considerably. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9a7fad8a-b4a2-42f0-b715-de6f96723068%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Rochit Sen
2013-May-21 16:07 UTC
Re: Re: Help needed - No route matches [GET] "/draw/load"
mike wrote in post #1109705:> On Tuesday, May 21, 2013 1:35:37 AM UTC-4, tamouse wrote: >> >>> case, >> > I looked at the guide and also entered: >> > get ''draw#load'' >> > This is still not working. Can someone please send me a working example >> > or try similar thing themselves. I am really stuck on this. >> >> Maybe try: >> >> match ''draw/load'' => ''draw#load'' >> >> instead? >> > > I missed something in your original post. The above match statement > should > work with 3.2 for routing, but your view file needs to end in html.erb > for > embedded ruby, or haml. rhtml isn''t recognized. I also echo Colin''s > post, > there''s a lot that has changed with Rails and spending some time with a > decent tutorial and/or the edge guides would ease the transition > considerably.Hi Mike, Yes the issue was that i was using a .rhtml file. I created .erb and it worked :) Thanks a lot all for helping out. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b2b7e53a4959bf2715a237221b2c3109%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.