1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Remove trailing spaces.

This commit is contained in:
Dan Barber 2013-05-21 21:19:45 +01:00
parent 14e045b07f
commit 88be4180a4
10 changed files with 41 additions and 41 deletions

View File

@ -1,17 +1,17 @@
class Admin::AdminUsersController < Admin::AdminController class Admin::AdminUsersController < Admin::AdminController
def index def index
@admin_users = AdminUser.all @admin_users = AdminUser.all
end end
def new def new
@admin_user = AdminUser.new @admin_user = AdminUser.new
end end
def edit def edit
@admin_user = AdminUser.find(params[:id]) @admin_user = AdminUser.find(params[:id])
end end
def update def update
@admin_user = AdminUser.find(params[:id]) @admin_user = AdminUser.find(params[:id])
@ -54,7 +54,7 @@ class Admin::AdminUsersController < Admin::AdminController
def edit_password def edit_password
@admin_user = current_admin_user @admin_user = current_admin_user
end end
def update_password def update_password
@admin_user = current_admin_user @admin_user = current_admin_user

View File

@ -1,17 +1,17 @@
class Admin::CategoriesController < Admin::AdminController class Admin::CategoriesController < Admin::AdminController
def index def index
@categories = Category.all @categories = Category.all
end end
def new def new
@category = Category.new @category = Category.new
end end
def edit def edit
@category = Category.find(params[:id]) @category = Category.find(params[:id])
end end
def update def update
@category = Category.find(params[:id]) @category = Category.find(params[:id])

View File

@ -1,17 +1,17 @@
class Admin::PagesController < Admin::AdminController class Admin::PagesController < Admin::AdminController
def index def index
@pages = Page.all @pages = Page.all
end end
def new def new
@page = Page.new @page = Page.new
end end
def edit def edit
@page = Page.find(params[:id]) @page = Page.find(params[:id])
end end
def update def update
@page = Page.find(params[:id]) @page = Page.find(params[:id])

View File

@ -1,18 +1,18 @@
class Admin::PhotosController < Admin::AdminController class Admin::PhotosController < Admin::AdminController
before_filter :get_categories before_filter :get_categories
def index def index
@photos = Photo.paginate(:page => params[:page]) @photos = Photo.paginate(:page => params[:page])
end end
def new def new
@photo = Photo.new @photo = Photo.new
end end
def edit def edit
@photo = Photo.find(params[:id]) @photo = Photo.find(params[:id])
end end
def update def update
@photo = Photo.find(params[:id]) @photo = Photo.find(params[:id])
@ -50,9 +50,9 @@ class Admin::PhotosController < Admin::AdminController
format.xml { head :ok } format.xml { head :ok }
end end
end end
private private
def get_categories def get_categories
@categories = Category.all @categories = Category.all
end end

View File

@ -8,5 +8,5 @@ class ApplicationController < ActionController::Base
def after_sign_out_path_for(resource_or_scope) def after_sign_out_path_for(resource_or_scope)
new_admin_user_session_path new_admin_user_session_path
end end
end end

View File

@ -1,6 +1,6 @@
class Notifier < ActionMailer::Base class Notifier < ActionMailer::Base
default :from => "enquiries@danbarberphoto.com" default :from => "enquiries@danbarberphoto.com"
def contact_notification(sender) def contact_notification(sender)
@sender = sender @sender = sender
mail( :to => 'enquiries@danbarberphoto.com', mail( :to => 'enquiries@danbarberphoto.com',

View File

@ -6,7 +6,7 @@ class AdminUser < ActiveRecord::Base
# Setup accessible (or protected) attributes for your model # Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me attr_accessible :email, :password, :password_confirmation, :remember_me
# new function to set the password without knowing the current password used in our confirmation controller. # new function to set the password without knowing the current password used in our confirmation controller.
def attempt_set_password(params) def attempt_set_password(params)
p = {} p = {}
@ -14,7 +14,7 @@ class AdminUser < ActiveRecord::Base
p[:password_confirmation] = params[:password_confirmation] p[:password_confirmation] = params[:password_confirmation]
update_attributes(p) update_attributes(p)
end end
# new function to return whether a password has been set # new function to return whether a password has been set
def has_no_password? def has_no_password?
self.encrypted_password.blank? self.encrypted_password.blank?

View File

@ -2,20 +2,20 @@ require 'email_validator'
class Contact class Contact
include ActiveModel::Validations include ActiveModel::Validations
validates_presence_of :email, :name, :message validates_presence_of :email, :name, :message
validates :email, :email => true validates :email, :email => true
attr_accessor :id, :email, :subject, :name, :message attr_accessor :id, :email, :subject, :name, :message
def initialize(attributes = {}) def initialize(attributes = {})
attributes.each do |key, value| attributes.each do |key, value|
self.send("#{key}=", value) self.send("#{key}=", value)
end end
@attributes = attributes @attributes = attributes
end end
def read_attribute_for_validation(key) def read_attribute_for_validation(key)
@attributes[key] @attributes[key]
end end
@ -27,5 +27,5 @@ class Contact
end end
return false return false
end end
end end

View File

@ -2,19 +2,19 @@ class Photo < ActiveRecord::Base
has_and_belongs_to_many :categories has_and_belongs_to_many :categories
has_attached_file :photo, :styles => { :preview => "600x600", has_attached_file :photo, :styles => { :preview => "600x600",
:size17 => "476x476#", :size17 => "476x476#",
:size11 => "308x308#", :size11 => "308x308#",
:size8 => "224x224#", :size8 => "224x224#",
:size5 => "140x140#", :size5 => "140x140#",
:size3 => "84x84#", :size3 => "84x84#",
:size2 => "56x56#" }, :size2 => "56x56#" },
:storage => :s3, :storage => :s3,
:s3_credentials => "#{Rails.root}/config/s3.yml", :s3_credentials => "#{Rails.root}/config/s3.yml",
:s3_protocol => "https", :s3_protocol => "https",
:path => ":attachment/:id/:style.:extension", :path => ":attachment/:id/:style.:extension",
:bucket => 'danbarberphoto', :bucket => 'danbarberphoto',
:url => ':s3_domain_url' :url => ':s3_domain_url'
@@per_page = 11 @@per_page = 11

View File

@ -6,5 +6,5 @@ class EmailValidator < ActiveModel::EachValidator
object.errors[attribute] << (options[:message] || "is not valid") object.errors[attribute] << (options[:message] || "is not valid")
end end
end end
end end