http://edgar411.com

Google Custom Search



You are

|| Login | Register | Why Register? ||


Browse Authors Of Fragments And Output Reports

Browse Stock Symbols

Browse EDGAR Input Reports

Browse Output Reports

Browse Fragments Used To Create Output Reports


About Edgar411.com

Contact Edgar411.com

Terms and Conditions

Built by http://bikle.com
(Rails Development/Consulting)

RDoc of Edgar411.com

RDoc of ActiveScaffold Plugin

RDoc of Hpricot 0.6

RDoc of Ruby On Rails


Translations:
Built with:
GNU Emacs
Arorem
Subversion
Piston
FreeBSD
PostgreSQL
Rails 1.2
LoginSugar
Active Scaffold
Hpricot
Lighttpd
|| Home | Symbols | Input Reports | Output Reports | Fragments ||

Stock Symbols

Owner Of This Symbol Name Symbol Name Corporate Name Reports Available From EDGAR
bikle Google-This: ORCL Google-This: Oracle Corporation
Show
bikle Google-This: SUNW Google-This: Sun Microsystems, Inc.
Show
bikle Google-This: GOOG Google-This: Google, Inc.
Show

Source Code:

/controllers/asls/symbls_controller.rb

# Provides read-only view via active_scaffold
class Asls::SymblsController < ApplicationController

  skip_before_filter :authenticate_usr

  active_scaffold do |config|
    config.actions = [:list, :show, :search]
    config.label = "Stock Symbols"
    config.list.columns = [:usr, :name, :cname, :rpts]
    config.show.columns = [:usr, :name, :cname, :rpts]
    config.columns[:usr].label = "Owner Of This Symbol Name"
    config.columns[:name].label = "Symbol Name"
    config.columns[:cname].label = "Corporate Name"
    config.columns[:rpts].label = "Reports Available From EDGAR"
  end # active_scaffold block
end

/models/symbl.rb

class Symbl < ActiveRecord::Base

  validates_uniqueness_of :name, :message => " is already being used"
  # Associations should come after callbacks
  belongs_to :usr
  has_many :rpts

  protected

  def validate
    case
    # The controller will set name = "record_usr_id_ne_session_usr_id" if
    # I try to update a record I do not own.
    when name == "record_usr_id_ne_session_usr_id"
      errors.add_to_base "You can only update your records, not other's records."
    end # case
  end # validate
end # class

/helpers/asls/symbls_helper.rb

module Asls::SymblsHelper

  def name_column(record)
    return "#{googlethis(record.name)} #{record.name}"
  end # name_column

  def cname_column(record)
    return "#{googlethis(record.cname)} #{record.cname}"
  end # cname_column

end # module