Sha256: 718257722fa98fe50016e2ba841e9e37e2123e3bde6246c9d4bfdc8151c00f6d

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

class EventsController < Controller

  # Idea: Need to think about this more, but in lue of generators, we could have 
  # over-rideable defaults based on a responds_to/actions
  # Idea: This would also configure what actions a controller can respond to / route to (do we need routes?)
  responds_to :only => [:new, :create, :edit, :update, :destroy, :index, :show] # default options

  def show(id)
    @event = Event.find(id)
    render :show
  end

  def edit(id)
    @event = Event.find(id)
  end

  def update(id)
    # Note: How would this conflict with the previously set @event, should something be passed? augment params?
    @event = Event.find(id)
    @event.update_attributes(
      # 1. data from the current/old view?
      # 2. autosave was false
      :price => self.view.price
    )
    # render :edit # Idea: (self.view is loaded)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
teacup-0.0.1.pre proposals/other/app/controllers/events_controller.rb