Skip to content

Instantly share code, notes, and snippets.

@mjtko
Created September 4, 2011 20:07

Revisions

  1. mjtko revised this gist Sep 4, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions _form.html.erb
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,8 @@
    <%= f.input :medicamente_id do %>
    <%# select(:retetum, :medicamente_id, Medicamente.pastile) %>
    <%= select(:retetum, :medicamente_id, Medicamente.clase,
    {:onchange => "<%= remote_function(:url => {:action => :update_pastile},
    :with => "'clasa='+value") %>"}) %>
    {:onchange => remote_function(:url => {:action => :update_pastile},
    :with => "'clasa='+value")} %>
    <% end %>
    </div>
    <div class="pastile"><%= render 'pastile', :collection => @retetum.pastile %></div>
  2. @cuciferus cuciferus created this gist Sep 4, 2011.
    21 changes: 21 additions & 0 deletions _form.html.erb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <%= simple_form_for([@pacient, @retetum]) do |f| %>
    <%= f.error_notification %>

    <div class="inputs">
    <%= f.input :data %>
    <%= f.input :cantitate %>
    <%= f.input :serie %>
    <%= f.input :medicamente_id do %>
    <%# select(:retetum, :medicamente_id, Medicamente.pastile) %>
    <%= select(:retetum, :medicamente_id, Medicamente.clase,
    {:onchange => "<%= remote_function(:url => {:action => :update_pastile},
    :with => "'clasa='+value") %>"}) %>
    <% end %>
    </div>
    <div class="pastile"><%= render 'pastile', :collection => @retetum.pastile %></div>
    <br />
    <div class="actions">
    <%= f.button :submit %>
    <%= link_to 'Tipareste reteta', new_pacient_retetum_path(@pacient, :format=> 'pdf') %>
    </div>
    <% end %>