Sha256: 1c13cc0171df211357e28fda61b71e1d1499dd416620e2ac08708dc0230eda2b

Contents?: true

Size: 857 Bytes

Versions: 7

Compression:

Stored size: 857 Bytes

Contents

<div id="associated_<%= field %>">
  <% if one %>
    <%= link_to_if_path one.to_title, :target => '_blank' do resource_path(one) end %>
    <%= link_to_function t(:clear_associated), "clear_associated_#{field}()" %>
    <% javascript_tag do %>
      function clear_associated_<%= field %>() {
        $('associated_<%= field %>').replace("<%= escape_javascript render(:partial => "terbium/association/one", :object => nil, :locals => {:field => field}) %>");
        Event.addBehavior.reload();
      }
    <% end %>
    <%= hidden_field_tag "#{model_name}[#{field.association_key}]", one.id, :id => "associated_#{field}_#{one.id}" %>
  <% else %>
    <%= link_to t(:choose_associated), '#', :terbium_popup => resource_path(record, "associated_#{field}_choosing") %>
    <%= hidden_field_tag "#{model_name}[#{field.association_key}]" %>
  <% end %>
</div>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
puffer-0.0.8 app/views/puffer/association/_one.html.erb
puffer-0.0.7 app/views/puffer/association/_one.html.erb
puffer-0.0.6 app/views/puffer/association/_one.html.erb
puffer-0.0.5 app/views/puffer/association/_one.html.erb
puffer-0.0.4 app/views/puffer/association/_one.html.erb
puffer-0.0.3 app/views/puffer/association/_one.html.erb
puffer-0.0.2 app/views/puffer/association/_one.html.erb