Skip to content

Instantly share code, notes, and snippets.

View ugisozols's full-sized avatar

Uģis Ozols ugisozols

View GitHub Profile
# app/decorators/mailers/refinery/inquiries/inquiry_mailer_decorator.rb
Refinery::Inquiries::InquiryMailer.class_eval do
def confirmation(inquiry, request)
@inquiry = inquiry
mail :subject => Refinery::Inquiries::Setting.confirmation_subject(Globalize.locale),
:to => inquiry.email,
:from => "my_custom_from_name@something.com",
:reply_to => Refinery::Inquiries::Setting.notification_recipients.split(',').first
end
diff --git a/pages/app/controllers/refinery/admin/pages_controller.rb b/pages/app/controllers/refinery/admin/pages_controller.rb
index 4dd16da..01b2096 100644
--- a/pages/app/controllers/refinery/admin/pages_controller.rb
+++ b/pages/app/controllers/refinery/admin/pages_controller.rb
@@ -91,8 +91,7 @@ module Refinery
@valid_layout_templates = Pages.layout_template_whitelist &
Pages.valid_templates('app', 'views', '{layouts,refinery/layouts}', '*html*')
- @valid_view_templates = Pages.view_template_whitelist &
- Pages.valid_templates('app', 'views', '{pages,refinery/pages}', '*html*')
diff --git a/pages/app/controllers/refinery/pages_controller.rb b/pages/app/controllers/refinery/pages_controller.rb
index d4d6dbf..b6526f0 100644
--- a/pages/app/controllers/refinery/pages_controller.rb
+++ b/pages/app/controllers/refinery/pages_controller.rb
@@ -10,7 +10,7 @@ module Refinery
# This action is usually accessed with the root path, normally '/'
def home
- render_with_templates?
+ render_with_templates?(page, :template => "refinery/pages/home")
@ugisozols
ugisozols / gist:6002320
Created July 15, 2013 18:42
What's new/changed/removed in Refinery CMS 2.1.0

What’s new, changed and removed in version 2.1.0

This guide will provide a list of bullet points of the stuff that has been added, changed and removed in version 2.1.0.

endprologue.

Changes in behaviour

WARNING. Starting from 2.1.0 we dropped support for Ruby 1.8.×. 1.9.3 is the lowest version of
Ruby that is accepted. We strongly recommend upgrading if you’re still on 1.8.×.

@ugisozols
ugisozols / gist:5998256
Last active December 19, 2015 18:19
Refinery CMS long index name fix when upgrading from 2.0.x to 2.1.x
class RemoveMetaKeywordsFromSeoMeta < ActiveRecord::Migration
def up
with_index_name_fix do
remove_column :seo_meta, :meta_keywords
end
end
def down
add_column :seo_meta, :meta_keywords, :string
end
@ugisozols
ugisozols / gist:5983776
Last active December 19, 2015 16:29
DRAFT! Refinery CMS 2.1.0 upgrade guide

Upgrading from version 2.0.10 to version 2.1.x

This guide will guide you through the upgrade process from version 2.0.10 to version 2.1.×.

endprologue.

WARNING. This guide assumes that you will be upgrading from version 2.0.10 of Refinery CMS. If your application is not up-to-date we strongly recommend for you to upgrade it to version 2.0.10 before trying to upgrade to version 2.1.0.

WARNING. Before continuing make sure you have a backup copy of your application and database in case something goes wrong.

@ugisozols
ugisozols / gist:5955777
Last active December 19, 2015 12:38
Refinery::Pages::MenuPresenter guide draft

Additional menus

This guide will show you how to:

  • configure and use Refinery::Pages::MenuPresenter
  • use a decorator to add custom method to Refinery::Page class

endprologue.

Background

@ugisozols
ugisozols / gist:5917814
Created July 3, 2013 13:23
Middleware which speeds up Rails dev for apps with lots of assets
# turbo dev by Sam Saffron
# http://discuss.emberjs.com/t/what-are-people-doing-about-the-gazzillion-file-problem/1006/8
module Middleware
# this class cheats and bypasses rails altogether if the client attempts
# to download a static asset
class TurboDev
def initialize(app, settings={})
@app = app
end
# app/decorators/engine/refinery/i18n_decorator.rb
Refinery::I18n.module_eval do
built_in_locales.merge! :az => "Azerbaijan"
end
# run this once
git remote add refinery git://github.com/refinery/refinerycms.git
# run this every time you want to do a rebase from remote
git pull --rebase origin refinery master