This file contains 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
# Spree extension capistrano tasks | |
# -------------------------------- | |
# $ cap extension:site:update | |
# $ cap deploy:restart | |
#Or remove my snippets extension (not that I would, it's an integral part of the site) | |
# $ cap extension:snippets:remove | |
# $ cap deploy:restart |
This file contains 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.class.__send__(:define_method, 'restart') do | |
File.open(Rails.root.join("tmp/restart.txt"), "w+") do |f| | |
f.write(" ") | |
end | |
end |
This file contains 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 LiquidHandler | |
PROTECTED_ASSIGNS = %w( template_root response _session template_class action_name request_origin session template | |
_response url _request _cookies variables_added _flash params _headers request cookies | |
ignore_missing_templates flash _params logger before_filter_chain_aborted headers ) | |
def self.call(template) | |
new.compile(template) | |
end | |
def compile(template) |
This file contains 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 ActionView::Template::Handlers::Liquid | |
def self.call(template) | |
"ActionView::Template::Handlers::Liquid.new(self).render(#{template.source.inspect}, local_assigns)" | |
end | |
def initialize(view) | |
@view = view | |
end | |
def render(template, local_assigns = {}) |
This file contains 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
module LiquorTemplateLoader | |
def self.namespace_to_params(pack, namespace) | |
if namespace == :html | |
scope = pack.html_templates | |
externals = [ :site, :request ] | |
elsif namespace == :email | |
scope = pack.email_templates | |
externals = [ :site, :subscription ] | |
end |
This file contains 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
1. to Gemfile: | |
gem "rails3-jquery-autocomplete" | |
gem "jquery-ui-rails" | |
2. to active_admin.css.scss | |
@import "active_admin/mixins"; | |
@import "active_admin/base"; | |
@import "jquery.ui.all"; |
This file contains 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
<div class="navbar navbar-fixed-top"> | |
<div class="navbar-inner"> | |
<div class="container-fluid"> | |
<a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</a> | |
<a href="#" class="brand">Project name</a> | |
<div class="nav-collapse"> |
This file contains 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
unless Rails.env.production? | |
connection = ActiveRecord::Base.connection | |
connection.tables.each do |table| | |
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations" | |
end | |
sql = File.read('db/import.sql') | |
statements = sql.split(/;$/) | |
statements.pop |
This file contains 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
# Russian. Updated 2014-04-01 | |
ru: | |
admin: | |
js: | |
true: 'True' | |
false: 'False' | |
is_present: 'Не пустое' | |
is_blank: 'Пустое' | |
date: 'Дата ...' |
OlderNewer