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 Applicant < ActiveRecord::Base | |
attr_accessible :avatar_url, :email, :facebook_url, :google_plus_url, :linkedin_url, :name, :phone, :phys_address, :position_id, :phase_id, :resume_url, :search_url, :twitter_url, :website_url | |
validates :name, :presence => true | |
validates :phone, :presence => true | |
validates :email, :presence => true | |
validates :phys_address, :presence => true | |
validates_numericality_of :position_id :on => :create | |
validates_numericality_of :phase_id :on => :create |
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 create | |
@applicant = @position.applicants.new(params[:applicant]) | |
@applicant.phase_id = @position.phases.order(:sort_order).first.id | |
respond_to do |format| | |
if @applicant.save | |
format.html { redirect_to @position, notice: 'Applicant was successfully created.' } | |
format.json { render json: @applicant, status: :created, location: @applicant } | |
else | |
format.html { render action: "new" } |
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
</table> | |
<hr/> | |
<h1>Listing applicants</h1> | |
<table> | |
<tr> | |
<th>Name</th> | |
<th></th> |
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 create | |
@like = Like.new(params[:like]) | |
@like = @applicant.likes.new(params[:likes]) | |
@like.user_id = current_user.id | |
respond_to do |format| | |
if @like.save | |
format.html { redirect_to @like, notice: 'Like was successfully created.' } | |
format.json { render json: @like, status: :created, location: @like } | |
else |
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 | |
@applicant = Applicant.find(params[:id]) | |
@comments = @applicant.comments.includes(:user) | |
@comment = @applicant.comments.new | |
@like = @applicant.likes.new | |
respond_to do |format| | |
format.html # show.html.erb | |
format.json { render json: @applicant } | |
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
<h1>Likes</h1> | |
<% @comments.count == 0 %> | |
<p>Nobody likes this person. Sad, eh?</p> | |
<% else %> | |
<div> | |
<p><%= likes.count %> likes</p> | |
</div> | |
<% 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
private | |
def set_position | |
if @current_company | |
@position = @current_company.positions.find(params[:position_id]) | |
else | |
@position = Position.find(params[:position_id]) | |
end | |
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
private | |
def set_position | |
if @current_company | |
@position = @current_company.positions.find(params[:position_id]) | |
else | |
@position = Position.find(params[:position_id]) | |
end | |
end | |
private |
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 new | |
@user = User.new(params[:user]) | |
end | |
def create | |
@user = User.new(params[:user]) | |
if params[:key].present? | |
invite = Invite.find_by_key(params[:key]) | |
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
Scotts-MacBook-Air:picdigest scottmagdalein$ gem install aws-sdk | |
Fetching: uuidtools-2.1.3.gem (100%) | |
Building native extensions. This could take a while... | |
ERROR: Error installing aws-sdk: | |
ERROR: Failed to build gem native extension. | |
/Users/scottmagdalein/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb | |
checking for libxml/parser.h... *** extconf.rb failed *** | |
Could not create Makefile due to some reason, probably lack of | |
necessary libraries and/or headers. Check the mkmf.log file for more |
OlderNewer