Problem With Ruby on Rails Partials
Mar 06
I recently ran into a problem with Ruby on Rails partials and the link_to_remote tag. link_to_remote allows you to easily make AJAX calls to the server and replace the content of your div with text or HTML from the partial. Since I was using a layout file at the application level that included a header and navigation I didn’t not want to have this rendered within the partial. So what is generally done is within the controller is to tell the action not to render the layout:
def my_action
render(:layout => false)
end
While this worked great on my Windows machine I was having serious problems on my Mac. Whenever the action was executed I received the following error:
Missing template ./script/../config/..//app/views//layoutfalse.rhtml
It was as though Rails was trying to load a layout with the name false.html when I was actually setting the layout parameter to false. Unfortunately I wasn’t able to find anyone with the same problem so I decided to update my Rails install:
gem update rails
Which appeared to do the trick and now I’m able to load my partials with ease. I’ve come to expect minor setbacks with new technologies and this by no means changes my view of the great Rails framework. I’m just excited to see the rapid development support for OS X!
