This file contains hidden or 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
| def validate | |
| errors.add(:email, "must be valid.") unless email.include? ("@") | |
| if screen_name.include("") | |
| errors.add(:screen_name, "cannot include spaces.") | |
| end | |
| end |
This file contains hidden or 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
| def logout | |
| User.logout!(session,cookies) | |
| flash[:notice] = "Danke und Auf Wiedersehen!" | |
| redirect_to :action => "index", :controller => "site" | |
| end |
This file contains hidden or 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
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} ^[www\.]*blog.domain.de [NC] | |
| RewriteCond %{REQUEST_URI} !^/blog/.* | |
| RewriteRule ^(.*) /blog/$1 [L] |
This file contains hidden or 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 ReportsController < ApplicationController | |
| def index | |
| @reports = Report.all | |
| end | |
| def show | |
| @report = Report.find(params[:id]) | |
| end | |
| def new |
This file contains hidden or 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
| def index | |
| #@reports = Report.all | |
| @technician.reports | |
| end |
This file contains hidden or 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 ReportsController < ApplicationController | |
| #before_filter :find_technician | |
| def index | |
| @reports = @technician.reports | |
| end | |
| def show | |
| @report = @technician.report.find(params[:id]) | |
| end |
This file contains hidden or 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 Technician < ActiveRecord::Base | |
| attr_accessible :name, :email | |
| has_many :@reports | |
| end | |
| class Report < ActiveRecord::Base | |
| attr_accessible :technician_id, :title, :problem | |
| belongs_to :technician | |
This file contains hidden or 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 @report do |f| %> | |
| <%= f.error_messages %> | |
| <p> | |
| <%= f.label :technician_id %><br /> | |
| <%= f.text_field :technician_id %> | |
| </p> | |
| <p> | |
| <%= f.label :title %><br /> | |
| <%= f.text_field :title %> | |
| </p> |
This file contains hidden or 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
| rails g migration AddCustomerAppointmentToReport customer_appointment:date | |
| ## migration file | |
| class AddCustomerAppointmentToReport < ActiveRecord::Migration | |
| def self.up | |
| add_column :reports, :customer_appointment, :date | |
| end | |
| def self.down |
OlderNewer