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
<p id="notice"><%= notice %></p> | |
<ul> | |
<li> | |
<em>Name:</em> | |
<%= @weapon.name %> | |
</li> | |
<li> | |
<em>Condition:</em> | |
<span id="condition"><%= @weapon.condition %></span> | |
<%= link_to "Toggle", toggle_condition_user_weapon_path(@user, @weapon), remote: true %> |
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
<p id="notice"><%= notice %></p> | |
<ul> | |
<li> | |
<em>Name:</em> | |
<%= @weapon.name %> | |
</li> | |
<li> | |
<em>Condition:</em> | |
<span id="condition"><%= @weapon.condition %></span> | |
<%= link_to "Toggle", toggle_condition_user_weapon_path(@user, @weapon), remote: true %> |
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
ActiveRecord::Schema.define(:version => 20110814152905) do | |
create_table "tweets", :force => true do |t| | |
t.string "message" | |
t.string "location", :limit => 30 | |
t.boolean "show_location", :default => false | |
t.integer "zombie_id" | |
t.datetime "created_at" | |
t.datetime "updated_at" | |
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
class Tweet < ActiveRecord::Base | |
scope :recent, order('created_at desc').limit(4) | |
scope :graveyard, where(show_location: true, location: "graveyard") | |
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
ActiveRecord::Schema.define(:version => 20110814152905) do | |
create_table "categories" do |t| | |
t.string "name" | |
end | |
create_table "categorizations" do |t| | |
t.integer "tweet_id" | |
t.integer "category_id" | |
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
ActiveRecord::Schema.define(:version => 20110814152905) do | |
create_table "locations" do |t| | |
t.integer "name" | |
t.integer "tweet_id" | |
end | |
create_table "tweets" do |t| | |
t.string "message" | |
t.boolean "show_location", :default => false |
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
ActiveRecord::Schema.define(:version => 20110814152905) do | |
create_table "locations" do |t| | |
t.integer "name" | |
t.integer "tweeter_id" # BRAINS!!! | |
end | |
create_table "tweets" do |t| | |
t.string "message" | |
t.boolean "show_location", :default => false |
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 Tweet < ActiveRecord::Base | |
has_one :location, dependent: :destroy | |
end | |
class Location < ActiveRecord::Base | |
belongs_to :tweet | |
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
class TweetsController < ApplicationController | |
# GET /tweets/new | |
# GET /tweets/new.json | |
def new | |
@tweet = Tweet.new | |
respond_to do |format| | |
format.html # new.html.erb | |
format.json { render json: @tweet } |
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
ActiveRecord::Schema.define(:version => 20110814152905) do | |
create_table "weapons" do |t| | |
t.string "name" | |
t.integer "ammo" | |
t.boolean "is_broken" | |
end | |
end |
OlderNewer