On Dec 21, 2010, at 7:19 PM, thene...@gmail.com wrote: > screen_name is one of the parameters
Yes, but it's part of the *fact* hash... params[:screen_name] => nil params[:fact][:screen_name] => Denter > > Parameters: {"commit"=>"Add Fact", > > "authenticity_token"=>" > O9D0iM9ouiEZdU+98pkDh6BGunEltXuaoUNTVU2ezRs=", > > "fact"=>{"fact"=>"This is a fun fact 4.", "screen_name"=>"Denter", > > "email"=>"den...@email.com"}} > > Fact Columns (3.5ms) SHOW FIELDS FROM `facts` > > SQL (0.2ms) BEGIN > > SQL (0.3ms) ROLLBACK > > Rendering fact/add > > I am not sure why I get the rollback. > > On Tue, Dec 21, 2010 at 2:25 PM, Philip Hallstrom <phi...@pjkh.com> wrote: > > On Dec 21, 2010, at 12:05 PM, juhi wrote: > > > Everything looks ok, I can not see errors, I do not see anything in > > the table. > > > > This is my environment settings. > > > > Ruby version 1.8.6 (i386-linux) > > RubyGems version 1.3.7 > > Rack version 1.0 > > Rails version 2.3.4 > > Active Record version 2.3.4 > > Active Resource version 2.3.4 > > Action Mailer version 2.3.4 > > Active Support version 2.3.4 > > Application root /home/stud/fun_facts > > Environment development > > Database adapter mysql > > Database schema version 20101120032325 > > > > Out put from server: > > > > => Booting Mongrel > > => Rails 2.3.4 application starting on http://0.0.0.0:3000 > > => Call with -d to detach > > => Ctrl-C to shutdown server > > SQL (309.9ms) SET NAMES 'utf8' > > SQL (0.4ms) SET SQL_AUTO_IS_NULL=0 > > > > > > Processing FactController#add (for 127.0.0.1 at 2010-12-21 13:45:06) > > [GET] > > Fact Columns (714.5ms) SHOW FIELDS FROM `facts` > > SQL (3.3ms) BEGIN > > SQL (1.5ms) ROLLBACK > > Rendering fact/add > > > > Processing FactController#add (for 127.0.0.1 at 2010-12-21 13:45:50) > > [POST] > > Parameters: {"commit"=>"Add Fact", > > "authenticity_token"=>"O9D0iM9ouiEZdU+98pkDh6BGunEltXuaoUNTVU2ezRs=", > > "fact"=>{"fact"=>"This is a fun fact 4.", "screen_name"=>"Denter", > > "email"=>"den...@email.com"}} > > Fact Columns (3.5ms) SHOW FIELDS FROM `facts` > > SQL (0.2ms) BEGIN > > SQL (0.3ms) ROLLBACK > > Rendering fact/add > > > > I am not sure why we are getting the rollback. > > > > The debug setting on the page show that I am submitting the data. > > > > --- !map:HashWithIndifferentAccess > > commit: Add Fact > > authenticity_token: O9D0iM9ouiEZdU+98pkDh6BGunEltXuaoUNTVU2ezRs= > > action: add > > fact: !map:HashWithIndifferentAccess > > fact: This is a fun fact 4. > > screen_name: Denter > > email: den...@email.com > > controller: fact > > > > I am not sure what is going wrong. > > > > My controller . > > > > class FactController < ApplicationController > > def index > > @title = "Index" > > end > > > > def add > > @title = "Add Facts" > > > > @fact = Fact.new(params[:screen_name]) > > params[:screen_name] doesn't exist. I think you want params[:fact] > > > > > respond_to do |format| > > if @fact.save > > format.html {flash[:notice] = 'Fact was successfully added.', > > redirect_to(@fact) } > > format.xml { render :xml => @fact, :status > > => :created, :location => @fact } > > else > > format.html { render :action => "add" } > > format.xml { render :xml => @fact.errors, :status > > => :unprocessable_entity } > > end > > end > > end > > > > end > > > > > > Thanks for the help! > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-t...@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.