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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta content="authenticity_token" name="csrf-param" /> | |
<meta content="fPle5r0Yt+C+ZWSf6ap4ctD+2CBuMxNrSBFaBViEM6M=" name="csrf-token" /> | |
<script src="/assets/jquery.js?body=1" type="text/javascript"></script> | |
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script> | |
<script src="/assets/jquery-ui.js?body=1" type="text/javascript"></script> |
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
show.html.erb | |
<% content_for :javascript_includes do %> | |
<%= javascript_include_tag "colleges.js" %> | |
<% end %> | |
application.html.haml | |
!!! | |
%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
>>>>> index.html.haml | |
%h1 Chat | |
%ul#chat | |
= render @chat_messages | |
= form_for ChatMessage.new, remote: true do |f| | |
= f.text_field :content | |
= f.submit "Send" |
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
%aside | |
%nav#sidenav | |
#team-sidenav | |
#accordion2.accordion | |
- if @current_user.teams.present? | |
- @current_user.teams.each_with_index do |team, i| | |
- i += 1 | |
.accordion-group | |
.accordion-heading | |
%a.accordion-toggle{"data-parent" => "#accordion2", "data-toggle" => "collapse", :href => "#collapse#{i.to_words.capitalize}"} |
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 User < ActiveRecord::Base | |
has_many :notes, foreign_key: "sender_id", dependent: :destroy | |
has_many :outgoing_notes, through: :notes, source: :user_recipient | |
has_many :incoming_notes, as: :receivable , | |
class_name: "Note", | |
dependent: :destroy | |
has_many :received_notes, through: :incoming_notes, source: :sender | |
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 Note < ActiveRecord::Base | |
attr_accessible :description, :sender_id, :receivable_id | |
belongs_to :sender, class_name: "User" | |
belongs_to :receivable | |
end | |
class User < ActiveRecord::Base | |
has_many :notes, foreign_key: "sender_id", dependent: :destroy | |
has_many :outgoing_notes, through: :notes, source: :user_recipient |
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 Note < ActiveRecord::Base | |
attr_accessible :description, :sender_id, :user_recipient_id, :team_recipient_id, :tournament_recipient_id | |
belongs_to :sender, class_name: "User" | |
belongs_to :user_recipient, class_name: "User" | |
belongs_to :team_recipient, class_name: "Team" | |
belongs_to :tournament_recipient, class_name: "Tournament" | |
end | |
class User < ActiveRecord::Base |
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
app/controllers/users_controller.rb:108:in `show' | |
actionpack (3.2.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action' | |
actionpack (3.2.6) lib/abstract_controller/base.rb:167:in `process_action' | |
actionpack (3.2.6) lib/action_controller/metal/rendering.rb:10:in `process_action' | |
actionpack (3.2.6) lib/abstract_controller/callbacks.rb:18:in `block in process_action' | |
activesupport (3.2.6) lib/active_support/callbacks.rb:425:in `_run__1894844828375605454__process_action__2695461369699905874__callbacks' | |
activesupport (3.2.6) lib/active_support/callbacks.rb:405:in `__run_callback' | |
activesupport (3.2.6) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks' | |
activesupport (3.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks' | |
actionpack (3.2.6) lib/abstract_controller/callbacks.rb:17:in `process_action' |
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
Started DELETE "/teams/1" for 127.0.0.1 at 2012-09-01 20:04:10 -0500 | |
Processing by TeamsController#destroy as HTML | |
Parameters: {"id"=>"1"} | |
WARNING: Can't verify CSRF token authenticity | |
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1 | |
Team Load (0.1ms) SELECT "teams".* FROM "teams" WHERE "teams"."id" = ? LIMIT 1 [["id", "1"]] | |
Completed 500 Internal Server Error in 2ms |
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 TeamsController < ApplicationController | |
before_filter :only => [:edit, :update, :destroy] do |action| | |
action.redirect_if_not_team_admin(Team.find(params[:id]), @current_user) | |
end | |
def index | |
@teams = Team.all | |
respond_to do |format| |