app/controllers/sections_controller.rb in artfully_ose-1.0.0.rc4 vs app/controllers/sections_controller.rb in artfully_ose-1.1.0.rc1

- old
+ new

@@ -1,12 +1,17 @@ class SectionsController < ArtfullyOseController - before_filter :find_chart, :except => [:on_sale, :off_sale] + before_filter :find_chart, :except => [:on_sale, :off_sale, :edit] def new @section = @chart.sections.build() render :layout => false end + + def edit + @section = Section.find(params[:id]) + render :layout => false + end def create @section = Section.new params[:section][:price] = Section.price_to_cents(params[:section][:price]) @section.update_attributes(params[:section]) @@ -14,9 +19,15 @@ if @section.save Ticket.create_many(@chart.show, @section, @section.capacity, true) else flash[:error] = "We couldn't save your ticket type because " + @section.errors.full_messages.to_sentence end + redirect_to event_show_path(@chart.show.event, @chart.show) + end + + def update + @section = Section.find(params[:id]) + @section.update_attributes(params[:section]) redirect_to event_show_path(@chart.show.event, @chart.show) end def on_sale @qty = params[:quantity].to_i \ No newline at end of file