I know this sounds insane. ;)
My Line :
"#{escape_javascript(content_tag(:a, "edit", :href => edit_object_payment_url(@object, "\#{payment_id}")))
Then with interpolation, I inject my variables. Payment_id is a javascript variable. Is it possible to syntactically pass that variable into this escaped_javascript statement?
Your Rails view won't have access to JavaScript variables, so you won't be able to call the Rails URL helper methods like edit_object_payment_url
using JavaScript variables. But you could use JavaScript to construct the URL on the client side.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.