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 8104571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:53:17+00:00 2026-06-05T23:53:17+00:00

I am using a nested model form to edit all phone numbers of a

  • 0

I am using a nested model form to edit all phone numbers of a client. I think the way simple_form displays it can be improved if I place all phone attributes on one line.

Here is a code I currently have:

.main
  .form-inputs
    = f.input :lname, label: t('client.lname')
    = f.input :fname, label: t('client.fname')
    = f.simple_fields_for :phones do |phones_form|
      = phones_form.input :phone, label: 'Phone'
      = phones_form.input :kind, collection: [:home, :work, :cell, :unknown], label: 'Kind'
      = phones_form.input :_destroy, as: :boolean, label: 'Delete?'

  .form-actions
    = f.button :submit, value: t('client.submit'), class: 'btn btn-primary'

and it produces the following:
enter image description here

Is it possible to put nested model’s form attributes on one line (like this)?
enter image description here

  • 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-05T23:53:19+00:00Added an answer on June 5, 2026 at 11:53 pm

    Yah this is a CSS issue. In short you write it in style like so :

    = phones_form.input :kind, collection: [:home, :work, :cell, :unknown], label: 'Kind', style: 'width: 50px;' 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the setup of the R.B. railcast - #197 Nested Model Form
I'm using nested model form technique from Railscast 197 (ASCIIcast here ). But I'm
So I have model with an association and I'm using a single form with
Has anyone managed to make the example at http://railscasts.com/episodes/196-nested-model-form-part-1 work? When I followed through
I have a problem with the normal way rails operates when using nested forms
I'm using Rails 2.3.2, and trying to get a nested object form to work
I am having some issues with nested models in a form, using Rails 3.1rc4.
I am having trouble with my nested form. I am using Ryan Bates' code.
ok, I've been following: http://railscasts.com/episodes/196-nested-model-form-part-1 Here are the steps I've had to accomplish so
I am using Mongoid on Rails 3 and trying to build a nested form.

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.