search for: eventscontroller

Displaying 5 results from an estimated 5 matches for "eventscontroller".

Did you mean: eventcontroller
2008 Feb 13
5
Example controller spec no worky?
I''m trying to spec a dead simple "show non-existent record should render 404" case, but it seems the RecordNotFound exception is making it impossible for some reason. #controller def show @event = Event.find(params[:id]) end #spec - pretty much straight from the rspec site before do Event.stub!(:find) get :show, :id => ''broken'' end #
2011 Aug 14
5
Puzzled with form on multiple table rows
...t, true) end end end redirect_to (:action =>:index) end Here''s the log output from the first submit (when it works) Started POST "/admin/events/events/multi_params_edit" for 127.0.0.1 at Sun Aug 14 19:37:42 +0100 2011 Processing by Admin::Events::EventsController#multi_params_edit as HTML Parameters: {"commit"=>"save changes (not functional)", "authenticity_token"=>"3MJ8aUhRWkrsOTLzkcLup8s7wrQH387H7uJeeKEU9Ss=", "utf8"=>"✓", "is_ten_event_ids"=>["5", "12"...
2009 Sep 24
4
Action Controller ::MethodNotAllowed
...o create new record. The actions for the form are cancel, save, publish and preview. here''s the config/routes.rb file code snippet for the relevant controller - Events map.resources :events, :member => {:manage => :get}, :new => {:preview => :post, :publilsh => :post} The EventsController has functions for new, create, edit, update, manage, preview and publish. the new.html.erb snippet is <% form_for @event, :url => events_path, :html => {:multipart => true, :id => "event_form"} do |f| -%> <%= render :partial => "form", :locals => {...
2006 Feb 21
5
Abstracting ownership verification out of Controller
...o be able to edit or delete the event. I''ve got the proper foreign keys set up. I''ve finally arrived at the point where I can take baby steps with code, but looks like my first steps are in flagrant violation of the DRY principle. Here''s what I have so far in the "EventsController" and I know it''s ugly (but it works). def update @event = Event.find(params[:id]) if @event.user_id == session[:user] && @event.update_attributes(params[:event]) flash[:notice] = ''Event was successfully updated.'' redirect_to :action =...
2010 Feb 16
0
Strange routing(?) Issue
..., :url => {:action => "mapit", :controller => "events"} %> Please see controller and rake routes output below. Here is the problem, With both #1 and #2 line in routes.rb active, if I click the Map link nothing happens, I get a 404 ActiveRecord::RecordNotFound in EventsController#mapit <pre>Couldn''t find Event without an ID</pre> AND when I create a new event i just get redirected back to events index page, no record gets saved. If I uncomment the regular event route i.e. #1, then I still get the same error with the map link but now I can create and sa...