Skip to content

Instantly share code, notes, and snippets.

<h1>New product</h1>
<% @images.each do |image| %>
<%= image_tag image %>
<% end %>
<%= link_to 'Back', products_path %>
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
@tjarmain
tjarmain / _trending.html.erb
Created August 7, 2012 17:26
Trying to set up rendering of partials within tabs using AJAX
############ Models ############
class Fund < ActiveRecord::Base
attr_accessible :name
has_many :portfolios
end
class Investment < ActiveRecord::Base
class Stock < ActiveRecord::Base
attr_accessible :issuer, :portfolio_id
has_many :portfolios_stocks
has_many :portfolios, :through => :portfolios_stocks
end
class Portfolio < ActiveRecord::Base
Fund
has_many :portfolios
Portfolio
belongs_to :fund
has_many :stocks, :through => :portfolios_stocks # join table
portfolios_stocks