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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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