Skip to content

Instantly share code, notes, and snippets.

View radar's full-sized avatar

Ryan Bigg radar

View GitHub Profile

Welcome to #rubyonrails

Please behave in a polite, considerate and inclusive manner in the channel at all times. People volunteer their time in the channel to help people like you with your Rails problems and some respect (in both directions) will go an extremely long way.

These rules are in place so that you can get the quickest and best support from #rubyonrails.

Rule #0: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us.

  1. Do your research before hand. Your question may be answerable with a quick Google search or by simply experimenting. If you're using a method in Rails, look it up in the API Docs or in the Official Guides.
  2. If you've tried Googling, explain what terms you've tried to use so people can better help you.
require 'net/imap'
require 'rubygems'
require 'actionmailer'
require 'activerecord'
ActiveRecord::Base.establish_connection(:adapter => "mysql", :database => "mail", :username => "root")
class Address < ActiveRecord::Base
has_many :addresses_mails
has_many :mails, :through => :addresses_mails

Rails 4 Differences

Chapter 1

No differences.

Chapter 2

  • root :to => "dashboard#index" is now root "dashboard#index"`
  • Need to permit parameters within Subscribem::AccountsController

Keybase proof

I hereby claim:

  • I am radar on github.
  • I am ryanbigg (https://keybase.io/ryanbigg) on keybase.
  • I have a public key ASC-aRDIkJSCR3zgowwQoB5OZWdmqFoVWx5hTGyj_m2TPAo

To claim this, I am signing this object:

Spree (vs. Magento)

  • Spree does not offer media management as a CMS function

This is true, but we do have some extensions such as spree_static_content that do provide the ability to create extra pages for your site.

  • One page checkout is available on Magento, but not Spree

Assuming you mean the fields are all on one page: This is not provided by default, but it is relatively easy to customize Spree to do this. It's pretty commonly requested, and so it might be a good idea for us to provide a guide on how to do this.

@radar
radar / Exam.md
Last active August 7, 2018 02:20

JEP Exam Rubric

  • Gemfile entries
    • rubocop (under development)
    • rspec-rails (under development + test)
    • devise (outside of any group)
    • mongoid (outside of any group)
  • Generated Mongoid configuration present at config/mongoid.yml
  • Rubocop rules pass
  • db/seeds.rb
    • Creates a book
it 'has a method that will call the transaction class' do
Transaction.should_receive(:new);
bank.send(:make_deposit, 5);
end
def make_deposit(amount)
Transaction.new(self, 'deposit', amount);
end
@radar
radar / index.html.erb
Created June 15, 2018 05:26
Problematic code
<table>
<tr>
<th>Subject</th>
<th>Created At</th>
<th>Status</th>
</tr>
<% @tickets.each do |ticket| %>
<tr>
<td><a href="/ticket/<%= ticket.id %>"><%= ticket.subject %></a></td>
@radar
radar / file1.txt
Created February 26, 2018 03:22
the description for this gist
String file contents
@radar
radar / file1.txt
Created February 26, 2018 03:19
the description for this gist
String file contents