Skip to content

Instantly share code, notes, and snippets.

class ReportsController < ApplicationController
#before_filter :find_technician
def index
@reports = @technician.reports
end
def show
@report = @technician.report.find(params[:id])
end
def index
#@reports = Report.all
@technician.reports
end
@buk
buk / gist:919961
Created April 14, 2011 17:16
Fehlermeldung beim Aufruf von http://127.0.0.1:3000/reports
We couldn’t find that file to show.
class ReportsController < ApplicationController
def index
@reports = Report.all
end
def show
@report = Report.find(params[:id])
end
def new
@buk
buk / .htaccess
Created December 12, 2010 09:24
A .htaccess file to point a subdomain to a folder
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[www\.]*blog.domain.de [NC]
RewriteCond %{REQUEST_URI} !^/blog/.*
RewriteRule ^(.*) /blog/$1 [L]
def logout
User.logout!(session,cookies)
flash[:notice] = "Danke und Auf Wiedersehen!"
redirect_to :action => "index", :controller => "site"
end
def validate
errors.add(:email, "must be valid.") unless email.include? ("@")
if screen_name.include("")
errors.add(:screen_name, "cannot include spaces.")
end
end