Public Gists by josevalim

Gravatar
Wed Aug 05 01:43:02 -0700 2009
1
2
3
class ActionController::Presenter
  attr_reader :controller, :request, :format, :resource, :resource_location
 
Gravatar
Fri Jul 31 01:49:00 -0700 2009
1
2
3
class UsersController < ApplicationController
  respond_to :html, :xml, :json
 
Gravatar
Thu Jul 30 06:47:35 -0700 2009
1
2
3
class UsersController < ApplicationController
  respond_to :html, :xml
 
Gravatar
Wed Jul 15 13:47:25 -0700 2009
1
2
3
  # Configure generators default options.
  config.generators do |g|
    g.rails :helper => true, :stylesheets => true
Gravatar
Sat Jun 27 11:51:32 -0700 2009
1
2
3
jose:~/Work/github/rails/railties$[gen*] ruby bin/gen model
Usage:
  bin/gen model NAME [field:type, field:type] [options]
Gravatar
Sat Jun 27 01:24:57 -0700 2009
1
2
3
# PROBLEM
#
# In order to provide agnosticism, a controller generator should know
Gravatar
Fri Jun 26 03:39:38 -0700 2009
1
2
3
# Rails Generators invocations types.
#
# = PROBLEM
Gravatar
Sat Jun 13 02:45:31 -0700 2009
1
2
3
class Amazing < Thor::Group
  include Actions
 
Gravatar
Sun May 24 03:28:19 -0700 2009
1
2
3
module Remarkable
 
  module Pending
Gravatar
Fri May 15 11:28:40 -0700 2009
1
2
3
# COMMUNITY CHALLENGE
#
# How would you test this Quiz#problem method? Only two rules:
Gravatar
Tue Apr 28 08:08:14 -0700 2009
1
2
3
module ActiveRecord
  module Generators
    class ModelGenerator < Base
gist: 94700 Comparision of Remarkable w...
Gravatar
Mon Apr 13 13:45:39 -0700 2009
1
2
3
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
 
describe TasksController do
Gravatar
Tue Mar 17 12:12:10 -0700 2009
1
2
3
require 'autotest'
 
Autotest.add_hook :initialize do |at|
Gravatar
Mon Mar 16 09:23:25 -0700 2009
1
2
3
class ProjectsController < InheritedResources
  def set_flash_message!(status, default_message)
    message = if action_name == 'create' && status == :error
Gravatar
Wed Mar 04 03:08:59 -0800 2009
1
2
3
# What we had to do:
<% semantic_form_for @post do |form| %>
  <%= form.inputs :title, :created_at %>
Gravatar
Wed Mar 04 02:58:37 -0800 2009
1
2
3
# What I'm doing is:
<% form.buttons do %>
  <%= pretty_positive_button 'Create user' %>
Gravatar
Mon Feb 23 08:51:40 -0800 2009
1
2
3
module Spec
  module Rails
    module Example
Gravatar
Sun Feb 22 12:52:47 -0800 2009
1
2
3
class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash)
  cattr_accessor :current_fixtures
 
Gravatar
Wed Feb 18 10:10:00 -0800 2009
1
2
3
#!/bin/sh
 
mkdir -p /usr/local/src && cd /usr/local/src
Gravatar
Mon Feb 09 11:01:03 -0800 2009
1
2
3
require 'rubygems'
require 'active_support'