Skip to content

Instantly share code, notes, and snippets.

View tpendragon's full-sized avatar

Trey Pendragon tpendragon

  • Princeton University Library
  • Salem, OR
View GitHub Profile
class Carnivore < Player
before_save :set_lvl
def initialize(attributes = {})
super
self.xp = 0
self.max_xp = 50
self.hp = 5
self.max_hp = 5
self.ap = 3
## I need to have a Group that can consist of Users and/or Companies
class User
has_many :relationships
has_many :companies, :through => :relationships
has_many :groups, :as => :groupable
end
class Relationships
belongs_to :user
<%= form_tag products_path, method: :get do %>
<p>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", title: nil %>
</p>
<% end %>