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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0.sublime"> | |
<dict> | |
<key>name</key> | |
<string>Railscasts</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
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
# localized.rb | |
# | |
# Usage: | |
# | |
# include Localized | |
# attr_translated :title | |
# | |
# Model.title now returns title_<locale> or falls back to title_en | |
# |
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
# autoslug.rb | |
# | |
# Usage: | |
# | |
# include Autoslug | |
# attr_slug :title [, :slug] [, &block] | |
# | |
# Creates :slug from given :title when creating models if no :slug given | |
# Uses parameterize by default or can run :title through a &block: | |
# |
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
# Fixes https://github.com/amatsuda/kaminari/issues/133 | |
# put into /initializers/kaminari.rb | |
module Kaminari | |
module Helpers | |
class Paginator < Tag | |
class PageProxy | |
def inside_window? | |
if @options[:current_page] <= @options[:window] | |
@page <= (@options[:window] * 2) + 1 |
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
# application_controller.rb | |
class ApplicationController < ActionController::Base | |
before_action :make_action_mailer_use_request_host_and_protocol | |
def make_action_mailer_use_request_host_and_protocol | |
ActionMailer::Base.default_url_options[:protocol] = request.protocol | |
ActionMailer::Base.default_url_options[:host] = request.host_with_port | |
ActionMailer::Base.asset_host = "#{request.protocol}#{request.host_with_port}" | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Solarized (Firedev)</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
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
# spec/support/routing_helper.rb | |
class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper | |
def call(t, args) | |
t.url_for(handle_positional_args(t, args, { locale: nil }.merge( @options ), @segment_keys)) | |
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
# config/initializers/kaminari.rb | |
module Kaminari | |
module Helpers | |
class Paginator < Tag | |
def relevant_pages(options) | |
1..options[:total_pages] | |
end | |
class PageProxy |
OlderNewer