This file contains hidden or 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
| require 'builder' | |
| class Sitemap | |
| STATIC_URLS = ['/home/about', | |
| '/home/help', | |
| '/home/contact_us', | |
| '/home/terms'] | |
| class << self |
This file contains hidden or 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
| =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') |
This file contains hidden or 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
| # How to re-use the menu partial for a submenu in Refinery CMS >= 0.9.8.5 and < 0.9.9.22 | |
| # header menu (main menu) which hides its children. | |
| <%= render :partial => "/shared/menu", | |
| :locals => { | |
| :dom_id => 'menu', | |
| :css => 'menu', | |
| :collection => @menu_pages, | |
| :hide_children => true | |
| } -%> |
This file contains hidden or 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 SpreeSite | |
| class Engine < Rails::Engine | |
| def self.activate | |
| # Add your custom site logic here | |
| end | |
| paths.config.routes = "lib/spree_blank.rb" | |
| paths.config.initializers = "lib/spree_blank.rb" | |
| config.to_prepare &method(:activate).to_proc | |
| end |
This file contains hidden or 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
| # encoding: utf-8 | |
| # Be sure to restart your server when you modify this file. | |
| # Add new inflection rules using the following format | |
| # (all these examples are active by default): | |
| # ActiveSupport::Inflector.inflections do |inflect| | |
| # inflect.plural /^(ox)$/i, '\1en' | |
| # inflect.singular /^(ox)en/i, '\1' | |
| # inflect.irregular 'person', 'people' | |
| # inflect.uncountable %w( fish sheep ) |
This file contains hidden or 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
| # Some good references are: | |
| # http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x | |
| # http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/ | |
| # http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392 | |
| #1. Install PostgreSQL postgis and postgres | |
| brew install postgis | |
| initdb /usr/local/var/postgres | |
| pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
This file contains hidden or 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
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
This file contains hidden or 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
| namespace :assets do | |
| task :precompile, :roles => :web do | |
| run "cd #{release_path} && RAILS_ENV=production bundle exec rake assets:precompile" | |
| end | |
| task :cleanup, :roles => :web do | |
| run "cd #{release_path} && RAILS_ENV=production bundle exec rake assets:clean" | |
| end | |
| end |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # login as root and run this script via bash & curl: | |
| apt-get update | |
| apt-get install -y build-essential bison openssl libreadline5 libreadline5-dev curl \ | |
| git-core zlib1g zlib1g-dev libopenssl-ruby libcurl4-openssl-dev libssl-dev \ | |
| libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev \ | |
| mysql-client mysql-server |
This file contains hidden or 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 PostsController < ActionController::Base | |
| def create | |
| Post.create(post_params) | |
| end | |
| def update | |
| Post.find(params[:id]).update_attributes!(post_params) | |
| end | |
| private |
OlderNewer