Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force "respond_do" format

I am using RJS with Prototype. In my controller I have this code:

def method_name
    respond_to do |format|
        ...
        format.html
        format.js
    end
en

Is it possible to force the "respond_do" to use the 'format.html' whether or no the request is HTML or JAVA? If so, how to do it?

like image 464
user502052 Avatar asked Mar 06 '26 17:03

user502052


1 Answers

Don't use respond_to. Just let the controller action return or call render if you want to specify a particular view.

like image 53
ConsultUtah Avatar answered Mar 09 '26 05:03

ConsultUtah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!