Skip to content

Instantly share code, notes, and snippets.

View jraczak's full-sized avatar

Justin Raczak jraczak

View GitHub Profile
<div class="row">
<div class="span4">
<h2>Geolocation</h2>
<p>View my current projects leveraging the HTML5 Geolocation API. This will require a location-aware browser or mobile device.</p>
<p><a class="btn" href="geolocation_projects.html">Check out Geolocation &raquo;</a></p>
</div>
<div class="span4">
<h2>Manipulating the DOM</h2>
<p>My first attempts at using my early-stage JavaScript knowledge to manipulate elements in an HTML document using the DOM.</p>
<p><a class="btn" href="DOM_projects.html">Check out DOM &raquo;</a></p>
def create
@article = current_user.articles.new(params[:article])
respond_to do |format|
if @article.save
format.html { redirect_to(@article, :notice => t('articles.create_success')) }
format.xml { render :xml => @article, :status => :created, :location => @article }
else
format.html { render :action => "new" }
format.xml { render :xml => @article.errors, :status => :unprocessable_entity }
activerecord (3.2.1) lib/active_record/attribute_assignment.rb:88:in `assign_attributes'
activerecord (3.2.1) lib/active_record/attribute_assignment.rb:78:in `each'
activerecord (3.2.1) lib/active_record/attribute_assignment.rb:78:in `assign_attributes'
activerecord (3.2.1) lib/active_record/associations/association.rb:234:in `build_record'
activerecord (3.2.1) lib/active_record/base.rb:497:in `initialize'
activerecord (3.2.1) lib/active_record/reflection.rb:183:in `new'
activerecord (3.2.1) lib/active_record/reflection.rb:183:in `build_association'
activerecord (3.2.1) lib/active_record/associations/association.rb:233:in `build_record'
activerecord (3.2.1) lib/active_record/associations/collection_association.rb:112:in `build'
activerecord (3.2.1) lib/active_record/associations/collection_proxy.rb:46:in `__send__'
activerecord (3.2.1) lib/active_record/attribute_assignment.rb:88:in `assign_attributes'
activerecord (3.2.1) lib/active_record/attribute_assignment.rb:78:in `each'
activerecord (3.2.1) lib/active_record/attribute_assignment.rb:78:in `assign_attributes'
activerecord (3.2.1) lib/active_record/associations/association.rb:234:in `build_record'
activerecord (3.2.1) lib/active_record/base.rb:497:in `initialize'
activerecord (3.2.1) lib/active_record/reflection.rb:183:in `new'
activerecord (3.2.1) lib/active_record/reflection.rb:183:in `build_association'
activerecord (3.2.1) lib/active_record/associations/association.rb:233:in `build_record'
ActiveRecord::Schema.define(:version => 20120228154735) do
create_table "articles", :force => true do |t|
t.string "title"
t.text "body"
t.datetime "published_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "excerpt"
t.string "location"
NoMethodError in Users#show
Showing /Volumes/UserData/Users/jraczak/Desktop/agency_pipeline/app/views/users/show.html.erb where line #5 raised:
undefined method `email' for nil:NilClass
Extracted source (around line #5):
2:
3: <p>
Sonar::Application.routes.draw do
root :to => "echoes#index"
resources :echoes
resources :users
resource :session
match "/login" => "sessions#new", :as => "login"
match "/logout" => "sessions#destroy", :as => "logout"
end
@jraczak
jraczak / gist:1970322
Created March 4, 2012 03:06
Error Output
Started GET "/users" for 127.0.0.1 at Sat Mar 03 22:04:35 -0500 2012
Processing by UsersController#index as HTML
User Load (0.2ms) SELECT "users".* FROM "users"
Rendered users/index.html.erb within layouts/application (1.4ms)
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
Completed 500 Internal Server Error in 10ms
ActionController::RoutingError (No route matches {:action=>"edit", :controller=>"users"}):
app/views/layouts/application.html.erb:16:in `_app_views_layouts_application_html_erb__979438107_2174701280'
app/controllers/users_controller.rb:9:in `index'
NoMethodError in Users#index
Showing /Volumes/UserData/Users/jraczak/Desktop/nexus/app/views/users/index.html.erb where line #15 raised:
undefined method `each' for nil:NilClass
Extracted source (around line #15):
12: <th></th>
13: </tr>
@jraczak
jraczak / gist:1994740
Created March 7, 2012 18:09
controller source
class UsersController < ApplicationController
before_filter :authenticate, :only => [:edit, :update]
def new
@user = User.new
end
def create
@user = User.new(params[:user])
if @user.save