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
<%= form_for @customer, :html => {:multipart => true} do |f| %> | |
<%= f.hidden_field :id %> | |
<p> | |
<%= f.file_field :image %> | |
</p> | |
<p><%= f.submit "Upload" %></p> | |
<% 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 CreateNotes < ActiveRecord::Migration | |
def change | |
create_table :notes do |t| | |
t.string :title | |
t.text :comment | |
t.timestamps | |
end | |
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 Notes < ActiveRecord::Migration | |
def up | |
end | |
def down | |
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 CustomersController < ApplicationController | |
before_filter :authenticate_user! | |
# GET /customers | |
# GET /customers.json | |
def create | |
@customer = Customer.new(params[:customer]) | |
@customer.user_id = current_user.id | |
if @customer.save |
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
<%- model_class = Customer -%> | |
<div class="page-header"> | |
<h1><%=t '.title', :default => model_class.model_name.human %></h1> | |
</div> | |
<dl class="dl-horizontal"> | |
<dt><strong><%= model_class.human_attribute_name(:name_first) %>:</strong></dt> | |
<dd><%= @customer.name_first %></dd> | |
<dt><strong><%= model_class.human_attribute_name(:name_last) %>:</strong></dt> | |
<dd><%= @customer.name_last %></dd> |
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
While working through the setup of the latest release of Spree, I ran into an error concerning "gem devise-encryptable" it seems that you can solve this error by simply moving the "gem devise-encryptable" line to the bottom of the gemfile. | |
source 'https://rubygems.org' | |
gem 'rails', '3.2.11' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' |
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
22:45][myapp(master)][v. ruby-1.9.3-p194]$ heroku logs | |
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap' | |
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>' | |
2013-02-05T20:30:24+00:00 app[web.1]: from script/rails:6:in `require' | |
2013-02-05T20:30:24+00:00 app[web.1]: from script/rails:6:in `<main>' | |
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval' | |
2013-02-05T20:30:24+00:00 app[web.1]: from /app/config.ru:in `<main>' | |
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>' | |
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app' | |
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1 |
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
source :rubygems | |
def darwin_only(require_as) | |
RUBY_PLATFORM.include?('darwin') && require_as | |
end | |
def linux_only(require_as) | |
RUBY_PLATFORM.include?('linux') && require_as | |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.12' | |
group :development do | |
gem 'sqlite3' | |
end | |
group :production do |
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
<h1>Welcome aspiring rubyists!</h1> | |
<p>I created this site as a resource for those who want to give ruby/rails a try and just don't really know where to start. There are so many resources out there, it can be a bit overwhelming. I decided to put together a site with some of the most popular resources in hopes of helping people get off to a great start!</p> | |
<p>If you are new to programming and want to see if ruby is something you might like, I recommend checking out some of the free interactive resources in the sidebar. These are great starters and will give you an general understanding of how ruby works. | |
</p> | |
<p>Once you get a feel for things and decide that you want to move forward, use one of the simple installation tools at the top of the page. Setting up ruby/rails manually can be difficult, especially on a Windows machine, these tools will get you up and running fast. | |
</p> |
OlderNewer