This file contains 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
/Users/dainelvera/Code/Rails/thecollegetourist/app/controllers/explore_controller.rb:36: syntax error, unexpected '|', expecting '}' | |
@towns.each do { |t| if t.postcards.empty? @tow... | |
^ | |
/Users/dainelvera/Code/Rails/thecollegetourist/app/controllers/explore_controller.rb:36: syntax error, unexpected keyword_end, expecting keyword_then or ';' or '\n' | |
...rds.empty? @towns.delete(t) end } | |
... ^ |
This file contains 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 explore | |
@states = State.find(params[:id]) | |
@towns = @states.towns.paginate(:page => params[:page], :per_page => 9) | |
#@towns.each do |t| | |
@towns.each {|t| if t.postcards.empty? @towns.delete(t) end } | |
t.postcards.last | |
end | |
end |
This file contains 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 Admin < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, | |
# :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable | |
This file contains 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 self.from_omniauth(auth,admins) | |
where(auth.slice(:provider, :uid)).first_or_initialize.tap do |authentication| | |
authentication.admin_id = admins.id | |
authentication.provider = auth.provider | |
authentication.uid = auth.uid | |
authentication.oauth_token = auth.credentials.token | |
authentication.oauth_expires_at = Time.at(auth.credentials.expires_at) | |
authentication.save! | |
end | |
end |
This file contains 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
config.assets.precompile += %w( frontend.css frontendlogin.css backend.css backendlogin.css frontend.js frontendlogin.js backend.js backendlogin.js ) |
This file contains 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 "bundler/capistrano" | |
server "198.61.216.231", :web, :app, :db, primary: true | |
set :application, "samurai" | |
set :user, "deployer" | |
set :deploy_to, "/home/#{user}/apps/#{application}" | |
set :deploy_via, :remote_cache | |
set :use_sudo, false |
This file contains 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
@states.each{|t| if t.postcards.empty? t.postcards.delete(t) } | |
t.postcards.last | |
t.postcards.count | |
t.towns.last | |
end |
This file contains 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
@states = State.find(params[:id]) | |
@towns = @states.towns.paginate(:page => params[:page], :per_page => 9).order("town") | |
@towns.each do |t| | |
t.postcards.last | |
t.postcards.count | |
end | |
end |
This file contains 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
/Users/dainelvera/Code/Rails/thecollegetourist/app/controllers/explore_controller.rb:60: syntax error, unexpected '}', expecting keyword_then or ';' or '\n' | |
/Users/dainelvera/Code/Rails/thecollegetourist/app/controllers/explore_controller.rb:63: syntax error, unexpected keyword_end, expecting '}' | |
/Users/dainelvera/Code/Rails/thecollegetourist/app/controllers/explore_controller.rb:81: syntax error, unexpected keyword_end, expecting '}' | |
/Users/dainelvera/Code/Rails/thecollegetourist/app/controllers/explore_controller.rb:171: syntax error, unexpected keyword_end, expecting '}' |
This file contains 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
$(document).ready( function() { | |
//If state and city match then provide id | |
$('#postcard_state'), | |
$('#postcard_city') | |
.bind('change', function (e) { | |
if( $('#postcard_state').val() == "Alabama" && $('#postcard_city').val() == "Abbeville city") { | |
$("#hidden_town_id").html("<input id='postcard_town_id' name='postcard[town_id]' type='hidden' value='1'>"); | |
} | |
else if( $('#postcard_state').val() == "Alabama" && $('#postcard_city').val() == "Adamsville city") { | |
$("#hidden_town_id").html("<input id='postcard_town_id' name='postcard[town_id]' type='hidden' value='2'>"); |