Hi all, first post.

I have an inventory application for our computers.

The model is computer.rb and it has_many :networkadaptors, :dependent
=> :destroy

What I'd like to do, in the show action for a particular computer, is
be able to add its nested :networkadaptors

 In "regular" Rails, I'd probably put something like this in the views/
computers/show.html.erb

<% form_for(:computer, :url => computer_networkadaptors_path
(@computer)) do |f| %>
   <p>
                <%= f.text_field :networkadaptortype %>
   </p>
   <p>
                <%=f.text_field :macaddress %>
   </p>
   <p>
                <%= f.submit "Add a network adaptor" %>
   </p>
<% end %>

Also, when I create a new :computer, I'd like to be able to specify
the computer.category (another nested resource) it belongs to with a
collection select. In "regular" Rails I'd do something like this:

  <p>
        <%= f.label :category %><br />
        <%= collection_select(:computer, :category_id, Category.find
(:all, :order => "name"), :id, :name) %>
  </p>


Hobo probably has a nice way of allowing me to do this, enh? I've
tried reading through the DRYML documentation but I'll admit it's so
different from what I'm used to that I haven't a clue how it is
deriving my views.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to