Skip to content

Instantly share code, notes, and snippets.

View tubbo's full-sized avatar
:shipit:
i don't make rails apps you use, i make the rails apps you use faster..

Tom Scott tubbo

:shipit:
i don't make rails apps you use, i make the rails apps you use faster..
View GitHub Profile
<div id="header">
<h1>Food: <span style="color:#fe4900;">Menus</span></h1>
</div>
<div id="content-menus" class="content">
<div class="scroll">
<div id="menu-nav">
<h1>Menus</h1>
<ul><li><a href="?page=Menus&amp;section=Spring" class="local">Spring</a></li>
<li><a href="?page=Menus&amp;section=Summer" class="local">Summer</a></li>
<li><a href="?page=Menus&amp;section=Fall" class="local">Fall</a></li>
<div style="text-align: center">
<% form_for @artist do |f| %>
<div class="ui-state-error">
<%=f.error_messages %>
</div>
<%# content_tag(:div, f.error_messages, :class => 'ui-state-error') unless f.error_messages.empty? %>
<%= f.text_field :name, :rel => 'Enter stage/artist name' %><br /><br />
<%= f.text_field :city, :rel => 'Enter city and state' %><br /><br />
<br /><br />
<h1>Register an Artist Account</h1>
<div style="text-align: center">
<% form_for @artist do |f| %>
<div class="ui-state-error">
<%=f.error_messages %>
</div>
<%# content_tag(:div, f.error_messages, :class => 'ui-state-error') unless f.error_messages.empty? %>
You are <%= f.text_field :name %><br /><br />
class ArtistsController < ApplicationController
before_filter :login_required, :except => [:show]
before_filter :artist_required, :only => [:edit, :update, :destroy]
before_filter :ajax_required, :only => [:update, :destroy]
# Artist dashboard
#
# GET /user/1/artists
def index
@artists = Artist.find(:all, :conditions => {:user_id => current_user.id})
class CreateArtists < ActiveRecord::Migration
def self.up
create_table :artists do |t|
t.timestamps
# basic identification & associations
t.string :name, :null => false
t.references :user
t.string :city, :null => false
t.integer :state_id
Processing ArtistsController#create (for 127.0.0.1 at 2010-09-03 17:39:23) [POST]
Parameters: {"artist"=>{"city"=>"sdfasdfsdf", "name"=>"asdfsdfsdfdsfsd", "user_id"=>"1"}, "commit"=>"Create Artist Account", "action"=>"create", "authenticity_token"=>"R/8HjI2LC6eYHnthUKd1kR1/Te32XYOFhJg6qcgd8d4=", "controller"=>"artists"}
Theme Load (0.2ms) SELECT * FROM "themes" LIMIT 1
Network Load (0.4ms) SELECT * FROM "networks" LIMIT 1
User Load (0.8ms) SELECT * FROM "users" WHERE ("users"."id" = 1) LIMIT 1
Artist Create (0.0ms) SQLite3::SQLException: artists.name may not be NULL: INSERT INTO "artists" ("name", "city", "created_at", "updated_at", "user_id") VALUES(NULL, NULL, '2010-09-03 21:39:23', '2010-09-03 21:39:23', 1)
ActiveRecord::StatementInvalid (SQLite3::SQLException: artists.name may not be NULL: INSERT INTO "artists" ("name", "city", "created_at", "updated_at", "user_id") VALUES(NULL, NULL, '2010-09-03 21:39:23', '2010-09-03 21:39:23', 1)):
app/controllers/artists_controller.rb:93:in `creat
necromancer@factory illup$ script/server
./script/../config/boot.rb:5: uninitialized constant Rails (NameError)
from script/server:2:in `require'
from script/server:2
necromancer@factory ~$ rvm info
ruby-1.8.7-p302:
system:
uname: "Darwin factory.andrewdlong.ath.cx 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)"
zsh: "/bin/zsh => zsh 4.3.4 (i386-apple-darwin9.0)"
rvm:
ruby-1.8.7-p302:
system:
uname: "Darwin factory.andrewdlong.ath.cx 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)"
zsh: "/bin/zsh => zsh 4.3.4 (i386-apple-darwin9.0)"
rvm:
version: "rvm 1.0.6 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]"
@tubbo
tubbo / boot.rb
Created September 29, 2010 16:59
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
require 'rubygems'
gem 'rails'
Rails.root = "#{File.dirname(__FILE__)}/.." unless defined?(Rails.root)
module Rails
class << self
def boot!
unless booted?