The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Rails Edge: View file extention functionality has changed

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jamie Hill

Posts: 161
Nickname: jamie007
Registered: Nov, 2006

Jamie Hill is Managing Director of SonicIQ Limited in the UK specialising in XHTML, CSS and Rails.
Rails Edge: View file extention functionality has changed Posted: May 16, 2007 5:40 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jamie Hill.
Original Post: Rails Edge: View file extention functionality has changed
Feed Title: The Lucid
Feed URL: http://feeds.feedburner.com/thelucid
Feed Description: Lightweight ramblings and tips on Ruby and Rails.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jamie Hill
Latest Posts From The Lucid

Advertisement

It seems that on edge revision 6502 and later, the way that view file extensions has changed considerably.

I couldn’t work out why my tests were breaking when doing an xhr request to a new action which had a respond_to block setup for both html and js. It was returning the html instead of the rjs??

It turns out (after tearing my hair out for over three hours) that Changeset 6499 changes things in such a way that the normal new.rjs naming will not get picked up on an xhr request, you now need to add the request format to the extension before the template type i.e. new.js.rjs

This seemed a little odd at first but I am guessing it means you could have a new.js.erb file which is pretty cool as you could achieve the same as Dan Webb’s MinusR plugin.

What does seem a little odd is that a new.rjs will get picked up if you don’t give a respond_to at-all (I don’t know if this is a “feature” or a bug).

I’m am hoping that this may save someone some time.

Read: Rails Edge: View file extention functionality has changed

Topic: Hi, I'm Ruby on Rails, and I'm Java Previous Topic   Next Topic Topic: Microsoft: Dead, and Starting to Smell a Little

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use