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
### Keybase proof | |
I hereby claim: | |
* I am eileencodes on github. | |
* I am eileencodes (https://keybase.io/eileencodes) on keybase. | |
* I have a public key whose fingerprint is 12F2 6419 FD01 0115 7E0F 42F6 BA5C 5751 20BB E8DF | |
To claim this, I am signing this object: |
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
Calculating ------------------------------------- | |
INDEX: Integration Test | |
38.000 i/100ms | |
INDEX: Functional Test | |
100.000 i/100ms | |
------------------------------------------------- | |
INDEX: Integration Test | |
409.331 (± 6.8%) i/s - 2.052k | |
INDEX: Functional Test | |
1.016k (± 5.5%) i/s - 5.100k |
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 Widget < ActiveRecord::Base | |
# initialized contstant for the validator | |
VALID_COLORS = %(red white blue) | |
belongs_to :box | |
has_many :categorizations | |
has_many :categories, :through => :categorizations | |
validates_presence_of :name | |
validates_length_of :name, :minimum => 3 | |
validates_numericality_of :size |
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
one: | |
first_name: Test | |
last_name: Test | |
email_address: test@gmail.com | |
username: admin | |
password_digest: <%= BCrypt::Password.create('test') %> | |
two: | |
first_name: Test2 | |
last_name: Test2 |
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
group :development do | |
gem 'sqlite3' | |
end | |
group :production do | |
gem 'mysql' | |
end | |
# Use unicorn as the web server | |
gem 'unicorn' |
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
<div class="field"> | |
<%= f.label :created_at, "Published at" %> | |
<div class="datetime"> | |
<%= f.datetime_select :created_at %> | |
</div> | |
</div> |
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::PostsController < Admin::AdminController | |
#only showing the update method | |
def update | |
@post = Post.find(params[:id]) | |
if @post.valid? | |
add_author_to_post | |
save_or_remove_post_categorization | |
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
<div class="datetime"> | |
<% if @post.user.nil? %> | |
No author specified | |
<% else %> | |
<%= @post.user.username %> | |
<% end %> | |
</div> |
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
# create action for generate password token for forgot password | |
def create | |
user = User.find_by_email(params[:email]) | |
if user | |
user.generate_password_reset if user | |
render :index | |
else | |
flash.now.alert = "No such email address was found. Please try again." | |
render :action => 'new' | |
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
# index and new action in my password resets controller | |
def index | |
if current_user | |
redirect_to account_url | |
else | |
redirect_to '/login' | |
end | |
end | |
OlderNewer