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 | |
authenticate_user! | |
if user_signed_in? | |
respond_to do |format| | |
format.html { | |
flash.notice = t(:logged_in_succesfully) | |
redirect_back_or_default(products_path) | |
} | |
format.js { |
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
$ rake assets:precompile:nondigest RAILS_ENV=production --trace | |
Creating scope :search. Overwriting existing method PgSearch::Document.search. | |
** Invoke assets:precompile:nondigest (first_time) | |
** Invoke assets:environment (first_time) | |
** Execute assets:environment | |
** Invoke environment (first_time) | |
** Execute environment | |
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.spree/order" is no longer supported | |
** Invoke tmp:cache:clear (first_time) |
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 ChangeAmountTypeOnAdjustments < ActiveRecord::Migration | |
def self.up | |
change_column :adjustments, :amount, :decimal, :precision => 8, :scale => 2, :default => 0.0, :null => false | |
end | |
def self.down | |
change_column :adjustments, :amount, :decimal | |
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
$ rails g resource posters | |
script/rails:5:in `load': no such file to load -- /home/jd/isotope/spree/grassland/ext/spree_foofah/spec/dummy/script/rails (LoadError) | |
from script/rails:5:in `<main>' |
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
$ rails g resource posts | |
/home/jd/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- rails/engine/commands (LoadError) | |
from /home/jd/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' | |
from script/rails:8:in `<main>' |
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
background: #265377; /* Old browsers */ | |
background: -moz-linear-gradient(top, #265377 0%, #c9d0f2 16%, #c9d0f2 68%, #265377 100%); /* FF3.6+ */ | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#265377), color-stop(16%,#c9d0f2), color-stop(68%,#c9d0f2), color-stop(100%,#265377)); /* Chrome,Safari4+ */ | |
background: -webkit-linear-gradient(top, #265377 0%,#c9d0f2 16%,#c9d0f2 68%,#265377 100%); /* Chrome10+,Safari5.1+ */ | |
background: -o-linear-gradient(top, #265377 0%,#c9d0f2 16%,#c9d0f2 68%,#265377 100%); /* Opera 11.10+ */ | |
background: -ms-linear-gradient(top, #265377 0%,#c9d0f2 16%,#c9d0f2 68%,#265377 100%); /* IE10+ */ | |
background: linear-gradient(top, #265377 0%,#c9d0f2 16%,#c9d0f2 68%,#265377 100%); /* W3C */ | |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#265377', endColorstr='#265377',GradientType=0 ); /* IE6-9 */ |
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
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Fresh Site</title> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<link href="/stylesheets/screen.css?1316447731" media="screen" rel="stylesheet" type="text/css" /> | |
<meta name="csrf-param" content="authenticity_token"/> | |
<meta name="csrf-token" content="kYFCv0pQWHqRK1gDe5nKCRcRZ7CtnMDrtwKI6OhQNpw="/> | |
<script src="/javascripts/jquery-1.4.2.min.js?1316190297" 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
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title></title> | |
5 <%= stylesheet_link_tag :all %> | |
6 <%= javascript_include_tag :jquery, :defaults %> | |
7 <%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" %> | |
8 <%= csrf_meta_tag %> | |
9 </head> | |
10 <body> |
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
NoMethodError in Forem::TopicsController#show | |
undefined method `topics' for nil:NilClass | |
Rails.root: /home/jd/isotope/a2_fansites | |
Application Trace | Framework Trace | Full Trace | |
activesupport (3.1.0.rc5) lib/active_support/whiny_nil.rb:48:in `method_missing' | |
app/controllers/forem/topics_controller.rb:8:in `show' | |
actionpack (3.1.0.rc5) lib/action_controller/metal/implicit_render.rb:4:in `send_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
Using with factory-girl or machinist | |
But you’re using Machinist or FactoryGirl right?! To leverage all of the factories/blueprints you’ve written, you can just do stuff like | |
Given a user exists | |
And another user exists with role: "admin" | |
# later | |
Then a user should exist with name: "Fred" | |
And that user should be activated # this uses rspec predicate matchers |