Skip to content

Instantly share code, notes, and snippets.

@caike
Created January 22, 2011 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caike/791508 to your computer and use it in GitHub Desktop.
Save caike/791508 to your computer and use it in GitHub Desktop.
tweets#index
<% @presenter.tweets.each do |tweet| %>
<tr>
<td><%= tweet.status %></td>
<!--<td><%#= tweet.user.display_name %></td>-->
<td><%= tweet.user %></td>
<td><%= link_to 'Show', tweet %></td>
<td><%= link_to 'Edit', edit_tweet_path(tweet) %></td>
<td><%= link_to 'Destroy', tweet, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
class User < ActiveRecord::Base
has_many :tweets
has_one :account_setting, :dependent => :destroy
accepts_nested_attributes_for :account_setting
validates_presence_of :first_name, :last_name, :email
validates_uniqueness_of :email
def to_s
"#{first_name} #{last_name}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment