Here’s my controller method
def check
@added_word = Word.where(:word => params[:word][:word]).first
respond_to do |format|
format.js
end
end
In the view I have the following code:
$("#added_words").append("<%= @added_word.word %>, ");
How should i change the controller in order not to render the view if no record found ( false returned)?
Not very idiomatic, but it answers your question.