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
<!-- haml --> | |
%blockquote | |
I am not running for president. - | |
%strong | |
everyone | |
, ever | |
<!-- html --> |
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
class Album < ActiveRecord::Base | |
attr_accessible :title | |
has_one :artist , :dependent => :destroy | |
has_many :genres , :dependent => :destroy | |
accepts_nested_attributes_for :artist, :allow_destroy => true | |
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
def new | |
@company = Company.find(params[:id]) | |
@ticket = Ticket.new(:app => @ticket) | |
respond_to do |format| | |
format.html # new.html.erb | |
format.xml { render :xml => @company } | |
end | |
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
def to_key | |
new_record? ? nil : [ self.send(self.class.primary_key) ] | |
end | |
def persisted? | |
false | |
end |