Search Results

Search found 2 results on 1 pages for 'alkaloids'.

Page 1/1 | 1 

  • Why is my html getting mal-formed?

    - by alkaloids
    I have the following table in a form that's embedded in a formtastic form (semantic_form_for). Everything I ask to be generated by ruby shows up, but the table gets badly mangled (essentially, the tags NEVER get formed. The table headers get drawn correctly There are 14 available_date objects that get passed, and they alternate between having a time value of 1 or 2, so this is just terribly boggling, but probably simple to fix... <table class="availability_table"> <tr> <th>Date</th> <th>Early</th> <th>Late</th> </tr> <% f.fields_for :available_dates do |ad| %> <% if ad.object.time == 1 #if this is an early shift, then start the new row %> <tr><td><%= ad.object.date.strftime('%a, %b %d, %Y') %></td> <td><%= ad.collection_select(:availability , LookupAvailability.all.collect, :id, :name) %></td> <% else #otherwise end the row with just a box%> <td><%= ad.collection_select(:availability , LookupAvailability.all.collect, :id, :name) %></td></tr> <% end %> <% end %> </table> So like I said, the form functions properly, and the objects all get updated and displayed correctly and all that, it's just that the HTML isn't getting echo'd out properly so my table is all mangled. Help!

    Read the article

  • Routing problem with calling a new method without an ID

    - by alkaloids
    I'm trying to put together a form_tag that edits several Shift objects. I have the form built properly, and it's passing on the correct parameters. I have verified that the parameters work with updating the objects correctly in the console. However, when I click the submit button, I get the error: ActiveRecord::RecordNotFound in ShiftsController#update_individual Couldn't find Shift without an ID My route for the controller it is calling looks like this looks like this: map.resources :shifts, :collection => { :update_individual => :put } The method in ShiftsController is this: def update_individual Shift.update(params[:shifts].keys, params[:shifts].values) flash[:notice] = "Schedule saved" end The relevant form parts are these: <% form_tag( update_individual_shifts_path ) do %> ... (fields for...) <%= submit_tag "Save" %> <% end %> Why is this not working? If I browse to the url: "http://localhost:3000/shifts/update_individual/5" (or any number that corresponds to an existing shift), I get the proper error about having no parameters set, but when I pass parameters without an ID of some sort, it errors out. How do I make it stop looking for an ID at the end of the URL?

    Read the article

1