similar to: Formtastic and Access to Variables of Nested Model

Displaying 20 results from an estimated 5000 matches similar to: "Formtastic and Access to Variables of Nested Model"

2011 Oct 26
6
Add an index to a form
Hello, I''m having some trouble with forms, my app allows to enter data by using a multi-step form that has 7 steps. There are 3 steps that may let the user to add 1 form, for example there''s a step called "children" and that children has the following fields: * name * age * gender but one father may have more than 1 child and I''m adding another form with
2010 Jan 20
0
need help with nested forms and habtm
Hi, I''m currently stuck with a problem I just can''t find a clever solution for. I checked every tutorial, issuetracker, API reference I could find but found nothing to "enlighten" me --> I desperately need your help :-). My Question is: is it possible to use nested forms for habtm associations? --> Here some more info about what I wanted to do and what failed
2010 Sep 09
17
formtastic issue
Hello, I will try to explain it step by step :-) I just created a new rails 3 app, then I created a new controller... rails generate controller admin::users I didn''t forget to add the resources in the routes.rb file like this. namespace :admin do resources :users end Now I try to use formtastic to create the form but I get erorr that my users_path doesn''t exist?
2012 Sep 22
1
formtastic does not save at all
Rails 3.1.3 I am using Formtastic gem in order to deal with multi-select dependencies. <%= semantic_form_for(@give) do |f| %> <%= f.inputs do %> <%= f.input :departure, :collection => Departure.find(:all, :order=>:city).collect{ |c| [c.city,c.id]}, :required=>true %> <div id="destinationCity"> <%= render :partial =>
2013 Jan 27
0
Nested form for a has_one model that already exists
Here''s the gist of my problem: (using formtastic) Models: Person (has_one :color) Color So I have this database full of already populated Color entries via a whole separate controller + views for creating Colors. When creating a person, I want to be able to select a Color object without creating it. So I''m not looking for something such as: = semantic_form_for @person do
2011 Feb 21
1
Multiple custom CSS for Formtastic
Inside stylesheets I have formtastic.css and formtastic_changes.css. In formtastic_changes.css I have a custom with: form.formtastic { width: 700px; etc.. It is working ok but now in only one page only, need a narrower form, say 530. So I need to have two width set up. What is the best way to do this? I mean I do not want to change the other forms in the project, I just want to change the
2011 Oct 11
1
How to use carrierwave with active admin?
Hi, I''d like to upload images and videos with carrierwave at the active admin interface. Just to make it clear, the admin will change images and video at the website using active admin. if anyone knows how to do this please help me. Thank you, Rodrigo -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2010 Aug 17
2
[Form] Method POST & PUT problem
Hello, I have a form that should be a POST method, but Rails insist to put a hidden field "_method" that has the value "put" does anyone knows why? Thanks, David Sousa Controller: ------------------------------- def new @user = @current_user end ------------------------------------------- View: ------------------------------------- <% semantic_form_for @user,
2011 Oct 05
2
formtastic / activeadmin
Newbie question: want to following code to migrate to formtastic: <% f.fields_for :assets do |asset_fields| %> <% if asset_fields.object.new_record? %> <p> <%= asset_fields.file_field :asset %> </p> <% end %> <% end %> tried this: f.inputs "Appartment Details" do f.input :assets do |asset_fields|
2010 Jun 05
6
How do you update HABTM relationships or create.
Hi, I have a User model with a HABTM relation to a Role model and vice versa. So There''s a roles_users table that references :user and :role. I''m using formtastic, and in the user.edit.html.erb I have a line that outputs the roles as a multi-select list box. But the box is not showing the roles that have been assigned to the users. Another problem is that if I select a few
2009 May 12
2
2.3 Nested Model Forms; build new without updating existing
I''m trying to build something similar to a Facebook messaging app, in which the view displays all the messages for a particular thread, with a form box for replying at the bottom of the thread. The problem is that using fields_for generates form fields for each existing record, and for one new record. In this case, there is no need to edit existing messages - just a need to add new
2011 Apr 04
1
Best way to instanciate an empty address element in many nested fields_for
Hi! I have 3 models, User, Company and Address. Basically, a User belongs to a Company and an Address has one Company (because it can be linked to other models). In a form I want to display a User, its Company and its company Address, with fields_for. The problem is when my User has a Company, that does *not* have an Address: the part containing the Address is not displayed. I see 2 ways of
2009 Mar 16
2
nested forms in rails 2.3
Hi, Is there a simpler way to implement the view-component of nested forms as it was done in Railscast #75 (Complex Forms Part 3) in Rails 2.3? I''d like to add and remove the owned objects dynamically using AJAX requests, but using f.fields_for :object do |object_form| doen''t let me load new objects into the form - or at least I don''t fully understand how that should
2010 Nov 11
2
Rails 3 - Nested Forms, using Builder -- Check_box issue
Hello, I have the following: My Controller: def new . . @teammembers.each do |teammember| request = @request_thread.requests.build(:recipient_id => teammember.user_id, :full_name => ''Billy Bob T'') end My View: . . <%= f.fields_for :requests do |builder| %> <div class="field"> <%= builder.label
2009 Feb 09
2
how to get form parameters while using fields_for with nested attributes
hi all.. i am trying to use *fields_for* to get and save nested attributes in a form. i have a ''Partner'' model associated with an ''Address'' model. partner has_many :addresses although the form is displaying fine, but on submitting it the following error is shown: *can''t convert HashWithIndifferentAccess into Array* on this line: *@partner =
2010 Oct 15
1
Help with nested form: User and Artist
Artist is 1:1 with User. User has_one :artist In my artist model, I have: belongs_to :user accepts_nested_attributes_for :user However, in my artist _form, the name column from the user model does not display. I am doing: <% f.fields_for :user do |builder| %> <p class="fields"> <%= builder.label :name %> <%= builder.text_field :name %>
2012 Oct 16
0
How to avoid an attribute without passing it to post in formtastic
I am developing rails application. I have a check box in the form like: <td><%= b.check_box :chkbx, label: false, checked: false %></td> While submitting the form. I need to avoid passing checkbox name argument in the post. How to avoid checkbox attribute from passing it to post in formtastic? -- Posted via http://www.ruby-forum.com/. -- You received this message because
2012 Oct 31
2
What is Formtastic and SimpleForm gem ? Is any one of this is by default included in Rails ?
Hi all, I read Formtastic and SimpleForm gem. I am using 3.4 Q 1 Is any one of this is by default included in Rails ? Q2 Any advantage of this gems over simple form tags ? As per my knowledge we are using form helper , but still i raised the qustion ? Thanks Regards Fahim Babar Patel -- You received this message because you are subscribed to the Google Groups "Ruby
2011 Feb 17
16
Unindent ERB output
Hi all, I''d like to unindent a block of ERB specifically to combat the extra spacing being added to content inside <textarea> by the browser. Is there such a feature in ERB? I shall denote indentation with underscores in the pseudo code example below. Thanks in advance, Khoan. myview.erb: <html ...> __<%= render ''form'' %> </html>
2010 Feb 19
3
Hooking validates
I want to hook the validation routines so that I can flag html labels and change their color to better indicate which fields need to be corrected in a form. Is there a way to do this conveniently and/or conventionally? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this