I have two actions in my controller :
def find
@item = Item.find(params[:id])
render 'result', :id => @item.id
end
def result
@item = Item.find(params[:id])
respond_to do |format|
format.js
end
end
The issue in that I call first the find
action, then it calls the result
action but in the html format. So the 'format.js` is never triggered.
How can render, at the end of the find
action, the result
action in the js format ?
Thanks a lot !
Try this in your find method.
render 'result', :id => @item.id, :format => :js
render
method only renders views, doesn't call another action
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With