javascript - Executing a jQuery script when rendering -
i'd execute jquery script while rendering action in rails controller.
to more precise, have function in users controller ...
def create @user = user.new(user_params) if @user.save # successful save else render action: "new", layout: "signup" end end
... , want add class specific element in new.html.erb
file. need when rendering because don't want class added beforehand.
how can that?
Comments
Post a Comment