Ruby on Rails
Friday, September 15, 2017
Ok, I see where I made my error.
On Thursday, September 14, 2017 at 3:31:38 AM UTC-4, Colin Law wrote:
-- I refactored the names of a few things and it's working much better now.
On Thursday, September 14, 2017 at 3:31:38 AM UTC-4, Colin Law wrote:
On 14 September 2017 at 01:02, Joe Guerra <jgu...@jginfosys.com> wrote:Thanks. What should I do to fix it? Should I re-run the generator?You could start by trying Rob's suggestion.ColinTo view this discussion on the web visit https://groups.google.com/d/--On Tue, Sep 12, 2017 at 7:10 PM, Rob Biedenharn <rob.bie...@gmail.com> wrote:I'm removing most of the "noise" from your output and focussing on the gallery-relevant bits:--On 2017-Sep-12, at 17:29 , Joe Guerra <JGu...@jginfosys.com> wrote:here's the output of my routes... (sorry about the formatting)Prefix Verb URI Pattern Controller#Actiongallery_index GET /gallery(.:format) gallery#indexPOST /gallery(.:format) gallery#createnew_gallery GET /gallery/new(.:format) gallery#newedit_gallery GET /gallery/:id/edit(.:format) gallery#editgallery GET /gallery/:id(.:format) gallery#showPATCH /gallery/:id(.:format) gallery#updatePUT /gallery/:id(.:format) gallery#updateDELETE /gallery/:id(.:format) gallery#destroythe key bit to notice is that the index route is "named" gallery_index because you used:resources :galleryand :gallery is the singular formYou very likely want to say instead:resources :gallerieswhich will give you similar routes *except* from the index:[ruby-2.4.1p111] //tmp $ cd example/[ruby-2.4.1p111] tmp/example (master #%) $ rails g resources GalleryRunning via Spring preloader in process 61722Could not find generator 'resources'. Maybe you meant 'resource', 'resource_route' or 'assets'Run `rails generate --help` for more options.[ruby-2.4.1p111] tmp/example (master #%) $ rails g resource GalleryRunning via Spring preloader in process 61823invoke active_recordcreate db/migrate/20170912230824_create_galleries.rb create app/models/gallery.rbinvoke test_unitcreate test/models/gallery_test.rbcreate test/fixtures/galleries.ymlinvoke controllercreate app/controllers/galleries_controller.rb invoke erbcreate app/views/galleriesinvoke test_unitcreate test/controllers/galleries_controller_test.rb invoke helpercreate app/helpers/galleries_helper.rb invoke test_unitinvoke assetsinvoke coffeecreate app/assets/javascripts/galleries.coffee invoke scsscreate app/assets/stylesheets/galleries.scss invoke resource_routeroute resources :galleries[ruby-2.4.1p111] tmp/example (master #%) $ cat config/routes.rbRails.application.routes.draw doresources :galleries# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end[ruby-2.4.1p111] tmp/example (master #%) $ rails routesPrefix Verb URI Pattern Controller#Actiongalleries GET /galleries(.:format) galleries#indexPOST /galleries(.:format) galleries#createnew_gallery GET /galleries/new(.:format) galleries#newedit_gallery GET /galleries/:id/edit(.:format) galleries#editgallery GET /galleries/:id(.:format) galleries#showPATCH /galleries/:id(.:format) galleries#updatePUT /galleries/:id(.:format) galleries#updateDELETE /galleries/:id(.:format) galleries#destroyNote the routes for index, create, and new ^^-RobOn Tuesday, September 12, 2017 at 5:03:56 PM UTC-4, Colin Law wrote:On 12 September 2017 at 02:15, Joe Guerra <JGu...@jginfosys.com> wrote:
> ...
> I'm using... in my routes file.
>
> get resources :gallery
Why is the 'get' there?
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-ta...@googlegroups.com .
To post to this group, send email to rubyonra...@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ .af2a8305-0b83-4075-8b51- f0b610ac31a7%40googlegroups. com
For more options, visit https://groups.google.com/d/optout .
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-ta...@googlegroups.com .
To post to this group, send email to rubyonra...@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ .9D2B37D1-18F3-4FC0-9E65- 31E73C9DB0D1%40gmail.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-ta...@googlegroups.com .
To post to this group, send email to rubyonra...@googlegroups.com .msgid/rubyonrails-talk/ .CAOFgAMmKeJLm3Oj4Y% 2B4AYYDEbSC5xfeYvdjzd8tJPQCzXs hK9Q%40mail.gmail.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@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/da7f24cf-958a-4398-bdb9-6c4fc86f1da3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment