1

I want to send a simple variable from my view like: @data1 = "something" to my controller whitout a form or buttons, I want do it with another events like when "close any dialog window" and send it automatically to some method in my controller.

Thank you for your answer.

1

1 Answer 1

3

You can't do that (and don't want to). The Model-View-Controller pattern assumes the Controller is providing data (Models) to the View. Once the render method has been called the View is sent to the client browser. If you want the view to send data back to the controller you'll have to rely on HTTP and use links, forms or Javascript/Ajax.

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

1 Comment

Yep, Javascript/Ajax seems to be what he is looking for

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.