Ruby on Rails
Monday, November 11, 2013
turns out it was this line of code in the layout
On Friday, November 8, 2013 5:41:28 PM UTC, johnnybutler7 wrote:
-- <link REL="SHORTCUT ICON" HREF="">
give me strength!
On Friday, November 8, 2013 5:41:28 PM UTC, johnnybutler7 wrote:
Hi Guys,Strange issue going on, cant get to the bottom of it.I have a bog standard form which submits to the create action fine. If the validation fails however the new action is rendered with the appropriate errors,however in the logs i notice the index action is called silently and I can see the trace of sql, see below:controller codedef create@discussion = Discussion.new@discussion.assign_attributes(params[:discussion].merge( created_by_id: current_user.id), :as => :admin) respond_to do |format|if @discussion.saveformat.html { redirect_to discussion_path(@discussion), notice: "Discussion was successfully created."}elseformat.html { render 'new' }endendendStarted POST "/discussions" for 127.0.0.1 at 2013-11-08 17:35:29 +0000Processing by DiscussionsController#create as HTMLParameters: {"utf8"=>"✓", "authenticity_token"=>"Xmxr58tjF1TEUUWFL+u3/VNzl/ 1HM83kAeD60LieP/0=", "discussion"=>{"title"=>"", "body"=>"", "user_ids"=>[""]}, "commit"=>"submit"} [1m [36m (2.3ms) [0m [1mBEGIN [0m[1m [35m (2.2ms) [0m ROLLBACKblah blah.....Rendered discussions/new.html.erb within layouts/launchpad (50.5ms)Completed 200 OK in 362.0ms (Views: 274.6ms | ActiveRecord: 78.1ms)Started GET "/discussions" for 127.0.0.1 at 2013-11-08 17:35:30 +0000Processing by DiscussionsController#index as HTML[1m [36mUser Load (3.4ms) [0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 8 LIMIT 1 [0m[1m [35mContext Load (2.4ms) [0m SELECT "contexts".* FROM "contexts" WHERE "contexts"."id" = $1 LIMIT 1 [["id", "2"]][1m [36mRole Load (4.3ms) [0m [1mSELECT "roles".* FROM "roles" WHERE "roles"."name" = 'PC_USER' LIMIT 1 [0m[1m [35mRole Load (3.8ms) [0m SELECT "roles".* FROM "roles"Rendered admin/shared/_quick_links.html.erb (2.1ms) [1m [36mDiscussion Load (3.6ms) [0m [1mSELECT DISTINCT discussions.* FROM "discussions" INNER JOIN "discussions_users" ON "discussions_users"."discussion_id" = "discussions"."id" INNER JOIN "users" ON "users"."id" = "discussions_users"."user_id" WHERE (created_by_id = 8 OR discussions_users.user_id = 8 OR users.account_id = 1) [0m
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2722b727-fc82-4d1b-8f32-d9ffe5cbc75e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment