0

I am new to rails, coming in from an angular background. Is there are way to have a button trigger a controller method without having the page redirect? I would also like to somehow tie input fields to controller variables without getting models involved.

What I have is a multi-page form (customer's design, not mine). On each page I want to validate user input, but I don't want to create a model for every field of what will end up being one cohesive object.

Lalibelamonk
  • 63
  • 1
  • 8

1 Answers1

1
  1. You can call a controller action using AJAX. Just bind and ajax call on some button's onClick event and that's it. Also take a look at remote: true from jQuery-ujs

  2. You can also validate fields with JS if you don't want to touch models

AKovtunov
  • 567
  • 1
  • 6
  • 21