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 ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter :current_user | |
require 'open-uri' | |
require 'json' | |
require 'nokogiri' | |
require 'ostruct' |
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
require 'csv' | |
desc "Import colleges from csv file" | |
task :colleges => [:environment] do | |
file = "db/colleges.csv" | |
CSV.foreach(file, :headers => true) do |row| | |
Restaurant.create({ | |
:name => row[1] |
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
OpenURI::HTTPError in UsersController#update | |
404 Not Found | |
Rails.root: /Users/jamesfickel/Desktop/g_testing/g_alpha | |
Application Trace | Framework Trace | Full Trace | |
app/controllers/users_controller.rb:43:in `block in update' | |
app/controllers/users_controller.rb:26:in `update' | |
Request |
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 UsersController < ApplicationController | |
def new | |
@user = User.new | |
end | |
def create | |
@user = User.new(params[:user]) | |
if @user.save | |
flash[:notice] = "Thanks for signing up. Important! In order to have full functionality of the site, add your game accounts to your profile." |
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 update | |
@user = User.find(params[:id]) | |
respond_to do |format| | |
if @user.update_attributes(params[:user]) | |
if @user.sc2_url? | |
if @user.sc2_url[7,2] == 'us' | |
@user.sc2_server = "US" | |
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
<%= @sc2_character.achievement_points %> | |
<div id="profile_picture"><%= image_tag @user.image.url(:medium) %></div> |
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 show | |
if logged_in? | |
if !User.find(session[:user_id]).nil? | |
@user = User.find(session[:user_id]) | |
else | |
redirect_to welcome_path | |
end | |
else | |
redirect_to welcome_path | |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.6' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
gem 'paperclip' | |
gem 'aws-s3' |
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 show | |
require 'SC2Ranks' | |
if logged_in? | |
if !User.find(session[:user_id]).nil? | |
@user = User.find(session[:user_id]) | |
else | |
redirect_to welcome_path | |
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
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts. | |
To [email protected]:mh-sample-app.git | |
! [rejected] master -> master (non-fast-forward) | |
error: failed to push some refs to '[email protected]:mh-sample-app.git' | |
To prevent you from losing history, non-fast-forward updates were rejected | |
Merge the remote changes (e.g. 'git pull') before pushing again. See the | |
'Note about fast-forwards' section of 'git push --help' for details. |