This might be a better solution:
Code:
<%= hidden_field "uut", "workorder_id", params[:id] -%>
Also this:
Code:
Workorder.find(params[:id]).WONumber
should be done at the controller with something like:
Code:
@workorder = Workorder.find(params[:id])
and then passed to the view. The view code them becomes:
Code:
<p>Work Order <%= @workorder.WONumber %></p>
That will then allow you to catch instances where an id isn't passed to the page. At the moment such an occurance is going to cause errors.
Likewise:
Should be done at the controller with something like:
Code:
@boards = Board.find(:all)
and then passed to the view where the code would become:
Code:
<%= select("uut", "board_id", @boards).collect { |b| [b.RSI_Number, b.id] } ) %>
Bookmarks