Reputation: 573
Currently i am upgrading my app to rails 4 and using RJS in many places. later on i cames to know that RJS removed and its still available through prototype-rails gem .so that I have added the gem and included in applicaton.js,but still I am getting the same issue.
ActionView::MissingTemplate (Missing template lease/update, application/update with {:locale=>[:en], :formats=>[:js, :html, :xml, :html, :text, :js, :css, :ics, :csv, :png, :jpeg, :gif, :bmp, :tiff, :mpeg, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip], :handlers=>[:erb, :builder, :raw, :ruby, :rjs]}
sample code: we are using the old extension: ex:
def ajax_refer
render :update do |page|
page.replace_html "lease_container", :partial => "/lease/property_pipeline", :locals => {:note_collection => @note, :portfolio_collection => @portfolio_collection}
end
end
my view is property_pipeline.html.erb
my application.js have
//= require prototype
//= require prototype_ujs
//= require effects
//= require dragdrop
//= require controls
//= require jquery
//= require jquery_ujs
//= require_self
//= require_tree .
Upvotes: 0
Views: 1815
Reputation: 866
:rjs
is included among :handlers
and that's good, but it's hard to know what else is missing from the snippet. Per prototype-rails, did you also remember to update development configs? config.action_view.debug_rjs = true
in config/environments/development.rb
?
There's a related Stackoverflow thread about rjs being removed as the default JS library as of Rails 3.1 and how to handle JS rendering.
According to that thread:
As for your code, the reason it's not working is that it's an rjs template being interpreted as .js.erb, and this is likely just producing invalid JavaScript.
It might be easier to simply try changing the update.js.rjs
to update.js
in your views/lease
folder and use jQuery along the lines of:
$('#lease_container').html("<%= escape_javascript render property_pipeline %>");
Please let me know if this turns out useful. It would have been helpful to include what actually was rendered following the missing template call ... it would indicate the interpreted extension.
Upvotes: 1