similar to: Add data in between Simple Form association members

Displaying 20 results from an estimated 9000 matches similar to: "Add data in between Simple Form association members"

2012 Oct 09
0
Form Design issue - How to handle a parent association input..
I have an Event Model with a parent Place association class Event < ActiveRecord::Base belongs_to :place accepts_nested_attributes_for :place attr_accessible :place_attributes In a new event registration form, the user should have the choice to : - select from an existing Place - enter a new Place in a nested form = simple_form_for @event = f.association :place, :collection =>
2011 Jul 25
1
3 models in a form.
Hello, class Customer < ActiveRecord::Base has_many :deliveries class Delivery < ActiveRecord::Base has_many :delivery_items has_many :products, :through => :delivery_items belongs_to :customer class DeliveryItem < ActiveRecord::Base belongs_to :delivery belongs_to :product I create a new delivery for customer x: = simple_form_for @customer do |f| = f.simple_fields_for
2013 Jul 17
5
Why last doesn't return an ActiveRecord::Relation
Hello, Sorry if this has been still answered, I haven''t found nothing on it. I would love to know why ActiveRecord::Base#last doesn''t return an ActiveRecord::Relation just like all or where since an ActiveRecord::Relation can act more or less like an array (as specified here<https://github.com/rails/rails/commit/0a6833b6f701c8c8febadfe2f45e25df29493602> )? Thanks, have
2006 Nov 28
1
observe_form, observe_field, dynamic forms help
I made a pretty lengthy post on what I''m doing here: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/89a2b8e54a874dd9 Short version: I have a radio_button group of two. If one is clicked another pair of radio buttons is added, if the other is clicked it is removed. observe_form does not work for elements added after initial page load. observe_field does not work
2006 Jul 01
4
Radio_button in loop problem
Hi all, I can''t figure out why my radio_buttons won''t reflect the values stored in my database. I read through some of the previous posts -- is it true that they don''t work with integers? This is the code I''m using: <% for question in @survey.questions %> <%= debug question %> <%= radio_button ( "question", :question_id,
2013 Sep 11
0
Nonclinical Statistician
Pfizer is hiring a statistician supporting early drug discovery for Global Medicinal Chemistry and Pharmacokinetics, Dynamics and Metabolism (PDM). If interested, go to http://pfizercareers.com/ and search for job ID 985944. The location is Groton, Connecticut. Responsibilities The statistician will have a consulting-type role supporting a large pool of scientists in two large platform line
2006 Jun 27
1
Help me, I stuck ..
I have three tables and is not allowed to change data scheme: CREATE TABLE `applicants` ( `id` int(10) unsigned NOT NULL auto_increment, `fullname` varchar(60) NOT NULL default '''', `address` varchar(60) NOT NULL default '''', PRIMARY KEY (`id`) ) ; CREATE TABLE `positions` ( `id` int(10) unsigned NOT NULL auto_increment, `position_name` varchar(30)
2010 Mar 02
0
selection simulation
Hi, I was having trouble developing a looping function in a selection simulation that I'm trying to develop and I was hoping if someone could help. Basically, I have a matrix with a random generated numbers representing scores on the variables. The rows represent applicants and columns represent the variables. # Number of variables p<-5 # Number of applicants n_ap<-100 # Create random
2011 Aug 09
4
Nesting select and text_field in radio_button
I''m creating my first Rails app and need an idea creating forms. I have Meeting model with place attribute. I want to have two fields for Meeting.place = one would be select with places from other meetings or text_field if the place is being used first time. User would be selecting radio_button of which field he has used. So is there any way to nest select and text_field within 2
2008 Dec 21
1
Form issues : partials + AJAX vs simple JS / separate views + form_fors vs one view and fields_fors
Hi all! I am coding an application that keeps track of request to create college courses. An identified user (logically a faculty member) completes a form indicating the name of the course, the professor in charge, the course''s code, the date and place, the possible coprofessors and TAs and the type of website he or she wants to use as a teaching help (WebCT, Sakai, etc.). I have two
2010 Dec 02
0
Thinking Sphinx sorting problem
Hello all, I''m trying to get some records in my application to sort based on a SQL calculated value and am getting no records returned. I have checked and double checked and the query that TS is indexing is working out, but the problem is with the controller. Here is what I''m indexing: ---------------------------------------------------------- indexes
2006 Jul 20
2
using association properties in form helpers
sorry for the noob question: how do i reference an association''s properties in a form helper? e.g. if i wanted to build a select list to choose a user''s address''s state (user.address.state), how would i hook that to the "method" of collection_select collection_select :user, ???, States.find(:all)
2006 Jul 02
5
Question about setting field values for a belongs_to model
I have two tables, applicants, and skills where each applicant "has_many" skills, and each skill "belongs_to" an applicant. When I have a reference to an applicant and a (skill) id for one of their skills, I thought to update their skills by using @applicant.skills.find(id_of_skill).description = ''new description'' # even adding
2014 Apr 06
0
collection_check_boxes with has_many through: association Rails 4
I am trying to list all the categories a user can be interested in with check boxes so that a user can submit these interests through my join table. collection_radio_buttons works with a simple has_many, belongs_to association: <%= collection_radio_buttons(:listing, :category_id, Category.all, :id, :name do |b| %> <%= b.label { b.radio_button} %> <%= b.text %>
2010 Aug 23
3
Unable to upload images using native rails file upload
I am a rails newbie and am trying to build my first app. I have a jobs and categories controller and models respectively. CONTROLLER: def new @job = Job.new @catergory = Catergory.all respond_to do |format| format.html # new.html.erb format.xml { render :xml => @job } end end #THIS IS A group of 10 RADIO_BUTTONS TO SELECT A CATEGORY FROM. BY DEFAULT THE FIRST
2010 May 19
1
Cannot have both select and radio_button together on the same form
Hello, I''m new to Ruby on Rails. I am creating a form for searching purpose: <% form_for :src_cond, :url => {:action =>''search''} do |p| %> <%= p.radio_button("bd", "1") %> a <%= p.radio_button("bd", "2") %> b <%= p.select :bd2, %w[1 2 3 4],{},{:index=>nil} %> <%=
2011 Sep 23
1
Simple Association
Hello, I am new to rails and I need a little help getting started with a simple association. Here is what I am trying to do. I have a model, message, which has text and a user (do not need to worry about associating users to messages right now). These messages come in and I would like to create a response for each, which itself is a message. Then I would like to create a transaction paring these
2011 Jul 11
2
Pre-populating association
Hello, I think this is an easy one for the average Rails developer but I''m a bit stuck. I''m creating a simple voting app: any user can create a survey, with any number of questions, and other users can then vote by creating a ballot for that survey. Here''s the modeling: class Survey < ActiveRecord::Base has_many :questions has_many :eligibilities has_many
2011 Sep 01
0
do you think it's the best solution?
I have: class Shop < ActiveRecord::Base has_many :documents, :dependent => :restrict has_many :roles, :dependent => :restrict accepts_nested_attributes_for :documents accepts_nested_attributes_for :roles the shop _form is: = simple_form_for(@shop) do |shop_f| = render ''shared/error_messages'', :object => @shop = render :partial =>
2011 May 03
0
Simple_Form and Simple_Fields_For and working in Form_Tag, Fields_For
I have this form and i got it working as i want: <%= form_tag(update_individual_photos_path, :method => "put") do %> <%= fields_for "photos[]", @photo do |f| %> ................. <% end -%> <%= submit_tag("Post") %> <% end %> But i would like to move to doing this with simple_form_for and simple_fields_for but i cant get it