Class: IshLibEngine::Manager::NewsitemsController
- Inherits:
-
Manager::ManagerController
- Object
- Manager::ManagerController
- IshLibEngine::Manager::NewsitemsController
- Defined in:
- app/controllers/ish_lib_engine/manager/newsitems_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/ish_lib_engine/manager/newsitems_controller.rb', line 12 def create :create, ManagerNewsitem.new n = Newsitem.new params[:newsitem] n.report = Report.find params[:newsitem][:report_id] unless params[:newsitem][:report_id].blank? n.gallery = Gallery.find params[:newsitem][:gallery_id] unless params[:newsitem][:gallery_id].blank? n.photo = Photo.find params[:newsitem][:photo_id] unless params[:newsitem][:photo_id].blank? n.descr = params[:newsitem][:descr] @city = City.find params[:city_id] @city.newsitems << n if @city.save flash[:notice] = 'Success' redirect_to edit_manager_city_path( @city.id ) else flash[:error] = 'No Luck. ' + @city.errors.inspect render :action => :new_newsitem end end |
#destroy ⇒ Object
40 41 |
# File 'app/controllers/ish_lib_engine/manager/newsitems_controller.rb', line 40 def destroy end |
#index ⇒ Object
37 38 |
# File 'app/controllers/ish_lib_engine/manager/newsitems_controller.rb', line 37 def index end |
#new ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/controllers/ish_lib_engine/manager/newsitems_controller.rb', line 4 def new :new, ManagerNewsitem.new @newsitem = Newsitem.new @city = City.find params[:city_id] end |
#show ⇒ Object
34 35 |
# File 'app/controllers/ish_lib_engine/manager/newsitems_controller.rb', line 34 def show end |
#update ⇒ Object
43 44 |
# File 'app/controllers/ish_lib_engine/manager/newsitems_controller.rb', line 43 def update end |