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
| #1. Install postgis 1.5.3. Latest is 2.0.0, so using url old formula on github | |
| brew install https://raw.github.com/mxcl/homebrew/8a04a43763906e6a9bef68881acf997f3a6f6687/Library/Formula/postgis.rb | |
| #2. Create a template to be used on creating GIS-enabled databases | |
| createdb template_postgis | |
| #3. Import Postgis Data | |
| psql -d template_postgis -f /usr/local/Cellar/postgis/1.5.3/share/postgis/postgis.sql | |
| psql -d template_postgis -f /usr/local/Cellar/postgis/1.5.3/share/postgis/spatial_ref_sys.sql |
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
| <div id="header_block"> | |
| <div id="header_block_title"><%= title %></div> | |
| <div id="header_block_content"><%= content %></div> | |
| </div> | |
| <!-- | |
| call it with: | |
| <%= render 'header_block', title: "Something", content: "A bit more" %> |
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
| options = ActiveSupport::HashWithIndifferentAccess.new(YAML.load_file("#{Rails.root}/config/mailer.yml")[Rails.env]) | |
| ActionMailer::Base.smtp_settings = options[:smtp] | |
| ActionMailer::Base.delivery_method = :smtp | |
| ActionMailer::Base.default_url_options[:host] = options[:host] | |
| ActionMailer::Base.raise_delivery_errors = true if Rails.env.development? |
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 ContractorsController < ApplicationController | |
| def search; end | |
| def import; 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
| class Editor < ActiveRecord::Base | |
| belongs_to :user | |
| def do_editor_stuff;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
| def reverser(&block) | |
| words = yield | |
| words.reverse | |
| end | |
| describe "reverser" do | |
| it "reverses the string returned by the default block" do | |
| reverser { "hello" }.should == "olleh" | |
| 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
| class Appointment < ActiveRecord::Base | |
| attr_accessible :booking_resource_id, :boooking_id, :customer_id | |
| belongs_to :customer | |
| belongs_to :booking | |
| 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
| require "active_record" | |
| require "logger" | |
| puts ActiveRecord::VERSION::STRING | |
| # ActiveRecord::Base.logger = Logger.new(STDERR) | |
| ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:' | |
| ActiveRecord::Schema.define do | |
| create_table :people |
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
| <table> | |
| <% current_user.hospital_bookings.each do |hospital_booking| %> | |
| <tr> | |
| <td> | |
| <%= hospital_booking.hospital.try :name if hospital_booking == current_user.id %> | |
| </td> | |
| </tr> | |
| <% end %> | |
| <% if current_user.hospital_bookings.empty? %> | |
| <tr><td>No bookings found.</td></tr> |
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 Admin::PermissionsHelper | |
| def permissions | |
| ['view', 'create tickets', 'edit tickets', 'delete tickets', 'change states'] | |
| end | |
| end |