Jump to content

The ultimate community for Ruby on Rails developers.


Photo

rails 4 routing question


  • Please log in to reply
1 reply to this topic

#1 dcastellano1

dcastellano1

    Signalman

  • Members
  • 15 posts
  • LocationColumbus, Ohio

Posted 27 March 2014 - 01:28 PM

Hi,

 

Anyone know why the route 

      get "pages/teachers", :as => :teachers

 

might result in rendering layouts/pages as per below:

 

Started GET "/pages/teachers" for 127.0.0.1 at 2014-03-27 08:24:11 -0400
Processing by PagesController#teachers as HTML
  User Load (2.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 19 ORDER BY "users"."id" ASC LIMIT 1
  Rendered pages/teachers.html.erb within layouts/pages (22.6ms)
Completed 200 OK in 30ms (Views: 21.2ms | ActiveRecord: 6.9ms)
 
It is not rendering pages/teachers, but rather  layouts/pages.  Was working fine in Rails 3.2.x


#2 dcastellano1

dcastellano1

    Signalman

  • Members
  • 15 posts
  • LocationColumbus, Ohio

Posted 27 March 2014 - 05:59 PM

Nevermind.  Stupid mistake...   Had a pages file in layouts without a yield.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users