Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding description paragraph to ActiveAdmin /new Page

I have a page set up on ActiveAdmin and when the user clicks the "Create One" button, I want to add a short textbox on the /new page (either at the top or part of the actual form, whatever's easier) explaining what needs to be put into the form.

How can I do this?

like image 745
chendriksen Avatar asked Sep 02 '25 06:09

chendriksen


1 Answers

Active Admin gives complete control over the output of the form by creating a thin DSL on top of the fabulous DSL created by Formtastic (http://github.com/justinfrench/formtastic).

And you can add :hint for each form input like this:

form do |f|
  f.inputs 'Details' do
    f.input :title, :required => true, :hint => "This field should be filled in"
  end

  f.inputs 'Advanced' do
    f.input :keywords, :hint => "Example: ruby, rails, active-admin"
    ...
  end
end

Take a look Formtastic documentation, there is lot of capabilities...

like image 82
Talgat Medetbekov Avatar answered Sep 04 '25 21:09

Talgat Medetbekov