Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:47:40+00:00 2026-06-05T05:47:40+00:00

I have a simple Formtastic form with nested model as follow. <%= semantic_form_for @event

  • 0

I have a simple Formtastic form with nested model as follow.

<%= semantic_form_for @event do |form| %>
  <%= form.input :user_id , :as => :hidden, :value => @user.id %>
  <%= form.input :title %>
  <%= form.input :invitations, :as => :check_boxes, :collection => Group.find(:all, :order => "name ASC"), :for => :invitations, :name => "Invitation", :include_blank => false %>
  <%= form.buttons %>
<% end %>

Somehow, Formtastic puts my inputs into an unordered list as follow:

enter image description here

I wonder how I can change the setting to fix this.

Also, for the checkbox, Formtastic automatically add a nill option:

  Parameters: {"utf8"=>"✓", "authenticity_token"=>"XXX", "event"=>{"title"=>"test 15",  "type"=>"", "invitation_ids"=>["", "2", "1"]}, "commit"=>"Create Event"}

How should I fix this?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:47:42+00:00Added an answer on June 5, 2026 at 5:47 am

    I had this exact same issue. Here’s how I fixed it:

    ERB

    <div class="some_class">
       <%= semantic_form_for @event do |form| %>
          <%= form.input :user_id , :as => :hidden, :value => @user.id %>
          <%= form.input :title %>
          <%= form.input :invitations, :as => :check_boxes, :collection => Group.find(:all, :order => "name ASC"), :for => :invitations, :name => "Invitation", :include_blank => false %>
          <%= form.buttons %>
       <%= end %>
    </div>
    

    CSS

    .some_class {
       li {
          list-style-type:none;
       }
    }
    

    I’m not certain that this is the absolute correct way to solve the problem, but for me it has done what I wanted it to do. Hope this helps!

    I had tried adding a class to the forms specifically, but that wasn’t targeting the ‘li’ since it was a child of that element. Since formtastic creates the ‘li’, I decided to go to the parent element of the ‘li’ and target it from the top down.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple form. <form target=_blank action=somescript.php method=Post id=simpleForm> <input type=hidden name=url value=http://...> <input
I have simple aspx page that has a form and a input field in
I have simple user model: var user = Backbone.Model.extend({ initialize: function(){ this.bind(change:auth, function (){
I have a very simple rails 3 program with 2 models: a user model
I have simple user registration form. In which i am puting city as a
I have simple SSIS package in which On Error event handler I have created
Have simple Spring Security webapp with password encoding: <security:authentication-manager alias=authenticationManager> <security:authentication-provider user-service-ref=personService> <security:password-encoder hash=md5
I have simple multiple selection input <input multiple=true type=file name=image_name[] /> Now i would
i have simple form that uploads image to server and returns php string containing
I have simple component - CommandButton <tr:commandButton text=test styleClass=form-button actionBean=#{testPage} action=synchAction partialSubmit=true id=btnId />

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.