rubyonrailsin

A Ruby and Rails talk

Monday, March 15, 2010


[Rails] JS not recognized in link_to_remote respond_to?

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

In my view I have this test...

<%= link_to_remote('AJAX Alert', :url => '/sandbox/submit', :success
=> 'alert(request.responseText)') %>

In my controller, this works and alerts "AJAX Response"...

def submit
render :layout => false
end

But if I add the respond_to block, the format.js never gets
recognized...

def submit
respond_to do |format|
format.js {
render :layout => false
}
format.html {
# render normal layout
}
end
end

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive