I'm brand new to Rails, so please excuse any wildly inaccurate terminology. First, some context: I am creating a sample tracking web application for a small analytics lab. It would be especially smooth to split the package presentation form into three columns. The package is associated with several tests in column 1, batch information is entered in column 2, and individual samples are named in column 3. Ideally, there will be a good submit button at the bottom of column 3 that pushes the whole mess through.
I use 960 (12 columns) for CSS and formtastic to generate the form. My first caveat is to set up the columns with three divs and split the form in each div, however I am not sure how to divide the form into divs, preserving what I hackerly call data constancy across all columns. Should I use divs? Here some code shows my general meaning:
.grid_4 # Test associating stuff .grid_4 = semantic_form_for @batch do |f| = f.inputs :name => "Batch Info" do = f.input :sampling_date, :required => false = f.input :experiment_name, :required => false = f.input :notes, :as => :text .grid_4 # The page obviously breaks without this line, but it makes the form only # pertain to the inputs in this column. = semantic_form_for @batch do |f| # The sample and test association stuff will be nested forms = f.semantic_fields_for :samples do |sample_form| = sample_form.input :sample_name = f.buttons do = f.commit_button :label => "Submit batch"
Thanks in advance for your help!
source share