-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rabl may be interfering with finding html templates (Rails 3.2.2) #180
Comments
This seems related: rails/rails@19433ce |
In my case I found out that when using render template using rabl within another (html) layout, like for instance:
any following call to render insists on json, so I had to make the format explicit again there:
Maybe this is just the way it works in Rails now... |
+1 |
I had a bitch of a time finding all the other renderings in my massive list of partials (client-side heavy, lots of template partials). So I added this to my helpers:
Then I had a file like show.html.erb render this:
Which then switches formats to JSON which bombs without the helper:
So the formats goes from :html to :json, renders out the RABL, and then back to :html The GOOD NEWS 👏 👏 👏 ... There is a fix in 3.2 stable (unreleased): |
Also, I added your comments to https://github.com/nesquena/rabl/wiki/RABL-and-Rails-3.2 thanks @carhartl |
FYI, Rails 3.2.3 does include the fix and you won't get template not found errors anymore even if the output format is different. |
Hi, Example: Error: MissingTemplate (Missing template api/projects/index, application/index with {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder, :coffee, :rabl]} |
What the code you're rending with? |
I too having this issue:
When i hit explore.json Template is missing Missing template main/index with {:handlers=>[:erb, :builder, :coffee, :rabl, :haml], :formats=>[:json], :locale=>[:en, :en]}. Searched in: * "D:/app/app/views" * "C:/Ruby/lib/ruby/gems/1.9.1/gems/devise-2.1.2/app/views" * "C:/Ruby/lib/ruby/gems/1.9.1/bundler/gems/rails_admin_tag_list-ca103dbca58e/app/views" * "C:/Ruby/lib/ruby/gems/1.9.1/bundler/gems/rails_admin-3684bd706770/app/views" * "C:/Ruby/lib/ruby/gems/1.9.1/gems/kaminari-0.14.1/app/views" RABL is interfering in default handlers |
I'm seeing this issue with rabl-0.8.5, rails 3.2.13 and ruby 1.9.3p194 must force format to :json, default format not working with :index method (other's are good) GET /companies - template not found |
Rails 3.2.2 appears to have made things worse. While trying to render an html page, Rails seems to be insisting on trying to find a json template:
The controller action has a respond_to block with format.html and format.json defined.
The problem goes away if I remove rabl so I suspect some weird rabl interaction with regard to registering. Also, this problem did not happen in Rails 3.2.1.
The text was updated successfully, but these errors were encountered: