This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # routes.rb | |
| resources :fidelity_bonds do | |
| resources :edits | |
| member do | |
| get :edit_principal | |
| end | |
| end | |
| # app/views/fidelity_bonds/edit_principal.html.haml | |
| = simple_form_for @fidelity_bond, :url => fidelity_bond_edits_path(@fidelity_bond) do |f| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def status | |
| return "pending" if effective_date > Date.today | |
| if cancellation_date | |
| cancellation_date <= Date.today ? "cancelled" : "pending_cancellation" | |
| else | |
| if expiration_date <= Date.today | |
| renew ? "renewed" : "expired" | |
| else | |
| "in_force" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GEM | |
| remote: http://rubygems.org/ | |
| specs: | |
| abstract (1.0.0) | |
| actionmailer (3.0.4) | |
| actionpack (= 3.0.4) | |
| mail (~> 2.2.15) | |
| actionpack (3.0.4) | |
| activemodel (= 3.0.4) | |
| activesupport (= 3.0.4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h1>Promotional Merchandise Request</h1> | |
| <h2>Available Items</h2> | |
| <% form_for @order do |order_form| %> | |
| <table> | |
| <% order_form.fields_for :line_items do |line_item_form| %> | |
| <% product = line_item_form.object.product %> | |
| <%= line_item_form.hidden_field :product_id %> | |
| <tr> | |
| <td><%= image_tag product.image.url %></td> | |
| <td><%= product.name %></td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Here is an example of how I use it in my a view (new.html.erb): | |
| <% content_navigation %> | |
| <%= render :partial => 'form' %> | |
| ========== | |
| This is my application helper: | |
| module ApplicationHelper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def content_navigation | |
| content_for :content_navigation do | |
| render :partial => 'navigation' | |
| end | |
| end |
NewerOlder