Vadim Novozhilov
Vadim Novozhilov

Reputation: 855

How to send data to ActiveAdmin in Rails 4?

I have a rate field form that's needs to be moderated by an admin and if everything's okay, show it on a page. So how can I send this form's data straight to the ActiveAdmin?

Upvotes: 0

Views: 216

Answers (1)

Timo Schilling
Timo Schilling

Reputation: 3073

It's easier to create a normal controller for that, wich stores the data and then ActiveAdmin shows up the data to the moderator.

If you really want to do that:

  1. Create a separate Namespace for the Form, name it form-admin (Other wise you will get a security problem or more).
  2. Configure this Namespace to not use devise.
  3. Turn of CSRF token controller do; protect_from_forgery :except => :create; end
  4. Send the form to /form-admin/your-modelname as post.
  5. If you need to know how the form looks like, copy it from /form-admin/your-modelname/new

Upvotes: 1

Related Questions