formtastic Questions

4

Solved

I am using active_admin. I am trying to make a form field required in activeadmin: input :team, as: :select, required: true, collection: Team.all.pluck(:name, :id), include_blank: "Please enter a...
Reversal asked 13/7, 2017 at 17:3

16

Is there a way to tell Rails to not create div.field_with_errors around both label and actually field, but to create div.error around them both? E.g. snippet from my view with the form (written in...

4

Solved

I am experiencing an N+1 query problem in an Active Admin (Formtastic) form. The query occurs when loading a select input that corresponds to a belongs_to association. The display_name on the assoc...
Ferebee asked 1/11, 2017 at 23:40

2

I have a simple model that can have multiple images attached via ActiveStorage handling the file storage. I am using ActiveAdmin to edit my model and to upload/attach the images - so far no proble...

6

using simple_form we can change class of a label using: label_html => {:class => "myclass"} but how do we do the same when dealing with checkboxes? simple_form assigns the default class of...
Liv asked 28/4, 2011 at 0:38

4

Solved

I am using Formtastic 2.1.1 in Rails 3.2 (with Active Admin) and I want to insert a row into my form that does not have an input field present. Is this possible and what is the syntax in the Formta...
Tauromachy asked 9/5, 2012 at 21:2

2

Using ActiveAdmin (0.5.1) I would like to make multiple different forms for creating an object and saving it to my database. I'm trying to do this by using ActiveAdmin.register_page, but I'm runnin...
Testimony asked 18/3, 2013 at 23:27

2

i got some problem with a resourceless form inside activeadmin page: ActiveAdmin.register_page 'TestDashboard' do menu :label => 'TestDashboard' content title: 'TestDashboard' do columns d...
Jemappes asked 30/5, 2014 at 12:6

5

Solved

I've a table with an integer column called "map_id", I want to add an activeadmin filter to filter if this column IS NULL or IS NOT NULL. How could this be implemented ? I tried the following fil...
Exegesis asked 20/8, 2012 at 12:57

4

Solved

I need formtastic to display only month and year fields, WITHOUT the day fields. The datepicker is nice but it shows the whole calendar. I don't want the datepicker. f.input :accounting_month, :l...
Arlinearlington asked 27/1, 2012 at 21:34

2

Solved

In my ActiveAdmin model I have a custom scope to show deleted records and several filters for searching records by specific columns. Using the filters individually or combined together works as e...
Gravitation asked 9/5, 2012 at 20:12

6

I have a edit form in Active Admin. I need some field as read only. My current edit page is like I need the page look like this How can this be done. My code for the edit form page is like ...
Thurlow asked 3/10, 2012 at 7:41

2

Solved

I have a model Product which has a belongs_to association with another model Type. In the product's form, I'm using formtastic to display a select tag with all the types available in the database, ...
Knob asked 9/6, 2013 at 23:12

6

Solved

Well I have a two models related with a on-to-many assoc. #models/outline.rb class Outline < ActiveRecord::Base has_many :documents end #models/document.rb class Document < ActiveRecord...
Belshazzar asked 29/11, 2011 at 12:50

1

Solved

I am working on a custom form in ActiveAdmin which I decided to use it for adding/editing to follow the DRY principle so I need to populate it if the user uses it for editing a record ( which isn't...
Turenne asked 9/7, 2017 at 12:27

3

Solved

I need to pass a collection to the standard select input in Formtastic: f.input :apple, :as => :select, :collection => Apple.all The problem is, though that I need Formtastic to access a d...
Dissatisfied asked 4/9, 2010 at 15:52

4

Solved

I started using formstatic but I need to make a file field with an image preview. I mean, when I edit an object, I want to see the image already linked. How can I do that?
Schopenhauer asked 16/8, 2011 at 16:36

4

Solved

I have a form I'm trying to set up ... Users can have many posts, and each post can have many people watching it. The Watch model is set up polymorphically as 'watchable' so it can apply to diffe...
Beforetime asked 29/4, 2010 at 5:23

2

Solved

I found this inside a method I want to override in the formtastic Gem. The method looks like: def to_html input_wrapping do hidden_field_html << label_with_nested_checkbox end end What...
Desulphurize asked 26/7, 2016 at 8:0

1

Solved

I want to save value from my checkbox's form as boolean, but i have got an array Chunk of my log "important"=>[""] or if i checked it "important"=>["",...
Joli asked 12/5, 2016 at 15:39

2

Solved

I'm trying to customise a ActiveAdmin form for a Recipe model that has a has_many relationship with Step. class Recipe < ActiveRecord::Base has_many :steps end class Step < ActiveRecord::B...
Steele asked 26/8, 2011 at 14:52

1

Solved

I'm using Ruby 2.1 and Rails 4.1. I installed ActiveAdmin (1.0.0.pre2). I want to format a datetime field expires_at in an ActiveAdmin form. I tried this in /app/admin/job.rb using jQuery datepicke...
Tabithatablature asked 11/10, 2015 at 12:1

3

Solved

I have a simple app, which has three models Assessment, Question and AssessmentQuestion In Assessment i have the association like, class Assessment < ActiveRecord::Base has_many :assessment_q...
Urinate asked 23/10, 2014 at 6:24

1

I am trying setup a select menu to associate a ImageGallery with a product. The ImageGallery is polymorphic since it is shared among a few models. Formtastic seems to be very confused about what to...

2

When I use formtastic DSL for ActiveAdmin edit form I get the following output: #< #< Class:0x00000006bd1f68>:0x00000006bd1018> <li class="file input optional" id="post...
Barroom asked 27/12, 2014 at 14:3

© 2022 - 2025 — McMap. All rights reserved.