-
The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]
-
jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]
-
Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]
-
The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]
| #!/usr/bin/env ruby | |
| # encoding: UTF-8 | |
| # Simple password generation in Ruby. | |
| # | |
| # Generate reasonably secure random passwords of any chosen length, | |
| # designed to be somewhat easy for humans to read and remember. | |
| # Each password has a capitalized letter and a digit. | |
| # | |
| # Example: |
| 1) backup production database: | |
| heroku pgbackups:capture --expire --remote production | |
| 2) obtain url string to backup from step 1: | |
| heroku pgbackups:url --app production_app_name --remote production_app_branch_name | |
| 3) transfer backup from production to staging app: | |
| heroku pgbackups:restore DATABASE 'production_app_backup_url_string_from_step_2' --app production_app_name --app staging_app_branch_name |
| # MySQL. Versions 4.1 and 5.0 are recommended. | |
| # | |
| # Install the MySQL driver: | |
| # gem install mysql2 | |
| # | |
| # And be sure to use new-style password hashing: | |
| # http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
| development: | |
| adapter: mysql2 | |
| encoding: utf8 |
| <?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>fileTypes</key> | |
| <array> | |
| <string>feature</string> | |
| </array> | |
| <key>firstLineMatch</key> | |
| <string>기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd(.*)</string> |
| # RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
| # defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
| module Player | |
| describe MovieList, "with optional description" do | |
| it "is pending example, so that you can write ones quickly" | |
| it "is already working example that we want to suspend from failing temporarily" do | |
| pending("working on another feature that temporarily breaks this one") |
| class CreateSearches < ActiveRecord::Migration | |
| def self.up | |
| ActiveRecord::Base.connection.execute <<-SQL | |
| CREATE VIEW searches AS | |
| SELECT authors.id AS searchable_id, authors.name AS term, | |
| CAST ('Author' AS varchar) AS searchable_type | |
| FROM authors | |
| UNION | |
| SELECT books.id AS searchable_id, books.title AS term, | |
| CAST ('Book' AS varchar) AS searchable_type |
| class Search < ActiveRecord::Base | |
| # We want to reference various models | |
| belongs_to :searchable, :polymorphic => true | |
| # Wish we could eliminate n + 1 query problems, | |
| # but we can't include polymorphic models when | |
| # using scopes to search in Rails 3 | |
| # default_scope :include => :searchable | |
| # Search.new('query') to search for 'query' |
Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down
One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.
Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |