Skip to content

Instantly share code, notes, and snippets.

@rubywarlock
Created June 7, 2017 06:05
Show Gist options
  • Save rubywarlock/4215fd3ff9877ff5fbd8242e773954d7 to your computer and use it in GitHub Desktop.
Save rubywarlock/4215fd3ff9877ff5fbd8242e773954d7 to your computer and use it in GitHub Desktop.
def my_controller_method
respond_to do |format|
if params[:request] == "one"
format.js {render :js_for_one} #это файл "_js_for_one.js.erb"
end
if params[:request] == "two"
format.js {render :js_for_two} #это файл "_js_for_two.js.erb"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment