mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
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
|
||||
@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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue