0

How can I use java script as a arguments of ruby function?

For example i want

<%= label :placehoder => result of javascript %>

1 Answer 1

1

You can't do this because the ruby part will run on the server before the javascript gets a chance to run in the browser. You can use a server side language to build javascript dynamically, but not the other way around.

A workaround would be to run an ajax request from javascript to pass data to the server.

Sign up to request clarification or add additional context in comments.

1 Comment

So I will not be able to pass the value from one form to another?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.