cleaned venue controller update method
This commit is contained in:
parent
7c35e39531
commit
b94ee7e758
2 changed files with 8 additions and 7 deletions
|
|
@ -6,13 +6,13 @@ class Admin::VenueController < ApplicationController
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@venue = @conference.venue
|
@venue = @conference.venue
|
||||||
venue_params = params[:venue]
|
if @venue.update_attributes!(params[:venue])
|
||||||
@venue.name = venue_params[:name]
|
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
||||||
@venue.address= venue_params[:address]
|
notice: 'Venue was successfully updated.')
|
||||||
@venue.website = venue_params[:website]
|
else
|
||||||
@venue.description = venue_params[:description]
|
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
||||||
@venue.save
|
notice: 'Venue Updation Failed!')
|
||||||
redirect_to(admin_conference_venue_info_path(:conference_id => @conference.short_title), :notice => 'Venue was successfully updated.')
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
class Venue < ActiveRecord::Base
|
class Venue < ActiveRecord::Base
|
||||||
|
attr_accessible :name, :description, :address, :website
|
||||||
has_many :conferences
|
has_many :conferences
|
||||||
before_create :generate_guid
|
before_create :generate_guid
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue