mirror of
https://github.com/openSUSE/osem.git
synced 2026-05-08 15:44:07 -04:00
cleaned venue controller update method
This commit is contained in:
@@ -6,13 +6,13 @@ class Admin::VenueController < ApplicationController
|
||||
|
||||
def update
|
||||
@venue = @conference.venue
|
||||
venue_params = params[:venue]
|
||||
@venue.name = venue_params[:name]
|
||||
@venue.address= venue_params[:address]
|
||||
@venue.website = venue_params[:website]
|
||||
@venue.description = venue_params[:description]
|
||||
@venue.save
|
||||
redirect_to(admin_conference_venue_info_path(:conference_id => @conference.short_title), :notice => 'Venue was successfully updated.')
|
||||
if @venue.update_attributes!(params[:venue])
|
||||
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
||||
notice: 'Venue was successfully updated.')
|
||||
else
|
||||
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
||||
notice: 'Venue Updation Failed!')
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Venue < ActiveRecord::Base
|
||||
attr_accessible :name, :description, :address, :website
|
||||
has_many :conferences
|
||||
before_create :generate_guid
|
||||
|
||||
|
||||
Reference in New Issue
Block a user