<%= f.input :state, :collection => ['SA', 'WA'] %> <%= f.input :state,
:as => :radio_buttons,
| <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
| /** | |
| * | |
| * @package Bread_crumb | |
| * @author John Kamuchau , [email protected] | |
| * @copyright Copyright (c) 2009, Web Flame , www.webflame.com.au/ | |
| * @license http://www.webflame.com.au/ | |
| * @link http://www.webflame.com.au/ | |
| * @since Version 1.0 | |
| * @filesource |
| if ($handle = fopen($csv_file, 'r')) | |
| { | |
| $all_headings = array_unique(explode(',', trim(fgets($handle)))); | |
| foreach ($all_headings as $heading) | |
| { | |
| if ( ! $heading) | |
| { | |
| break; | |
| } |
| class OauthController < ApplicationController | |
| class ApiOAuthError < StandardError | |
| attr_accessor :code, :description, :uri, :state | |
| def initialize(code, description, uri = nil, state = nil) | |
| @code = code | |
| @description = description | |
| @uri = uri |
| Running and install of twitter bootstrap rails | |
| rails g bootstrap:install | |
| rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid] | |
| Running Rspec installation | |
| group :development, :test do | |
| gem 'turn' | |
| gem 'rspec-rails' | |
| gem 'capybara' | |
| gem 'factory_girl_rails' |
| class PostsController < ActionController::Base | |
| def create | |
| Post.create(post_params) | |
| end | |
| def update | |
| Post.find(params[:id]).update_attributes!(post_params) | |
| end | |
| private |
| #$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path. | |
| require 'bundler/capistrano' | |
| require 'rvm/capistrano' | |
| require "capistrano_colors" | |
| require 'thinking_sphinx/deploy/capistrano' | |
| require 'delayed/recipes' | |
| set :normalize_asset_timestamps, false | |
| set :rvm_type, :user | |
| set :rvm_ruby_string, 'ruby-1.9.3-p125@appname' |
| $(function() { | |
| function split( val ) { | |
| return val.split( /,\s*/ ); | |
| } | |
| function extractLast( term ) { | |
| return split( term ).pop(); | |
| } | |
| $( "#new_interest" ).autocomplete({ |
| class Trainer.Views.LessonsIndex extends Backbone.View | |
| template: JST['lessons/index'] | |
| initialize: -> | |
| @collection.on('reset', @render, this); | |
| @collection.on('add', @render, this); | |
| render: -> | |
| $(@el).html(@template(lessons: @collection)) |