Skip to content

Instantly share code, notes, and snippets.

@tristanm
Created June 18, 2013 03:41
Show Gist options
  • Save tristanm/5802536 to your computer and use it in GitHub Desktop.
Save tristanm/5802536 to your computer and use it in GitHub Desktop.
A wireframing scaffold for Rails 2.3
class Wireframe < ActiveRecord::Base
def self.columns
@columns ||= [];
end
def self.column(name, sql_type = nil, default = nil, null = true)
columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
end
def method_missing(method_id, *args, &block)
# Ignore
end
end
class WireframesController < ApplicationController
def index
@views = Pathname.glob(Rails.root.join('app/views/wireframes/*.html.erb')).collect{ |f| f.basename.sub('.html.erb', '').to_s }.delete_if{ |f| f == 'index' }.sort
logger.debug @views.inspect
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment