Saturday 15 March 2014

ruby on rails 3 - Missing template with format js -



ruby on rails 3 - Missing template with format js -

in rails project want open modal box (face box) via ajax. code in index.html.erb:

<%= link_to 'anmelden', fb_login_path, :remote => true %>

this throws me error:

missing template facebox/fb_login, application/fb_login {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :arb, :coffee]}. searched in: ...

that right because template js.erb-file. read somewhere have add together in controller:

faceboxcontroller:

def fb_login respond_to | format | format.js end end

doing getting error:

started "/facebox/fb_login" 127.0.0.1 @ 2014-11-05 18:09:46 +0100 processing faceboxcontroller#fb_login html completed 406 not acceptable in 0ms (activerecord: 0.0ms)

this weird because lastly week worked. in meantime - far remember - didn't alter thing. getting error.

i know sounds weird hope can help me.

thanks! lars

edit

this ist fb_login.js.erb-code:

$.facebox('<%= escape_javascript(render :partial => 'devise/sessions/new') %>')

edit 2

here output rake routes

fb_login /facebox/fb_login(.:format) facebox#fb_login

and routes.rb:

match '/facebox/fb_login' => 'facebox#fb_login', :as => :fb_login

perhaps helps

setting 'rails' in gem file '3.2.20' , running 'bundle update rails' worked me.

ruby-on-rails-3

No comments:

Post a Comment