Hi, I have a rails app. upon creating a new record from the browser(although it is being created successfully) it doesnt show up in the browsers view. Connecting to the DB , i confirmed that the record is created. I should do a "Rake db:migrate" inorder to make the record appear on the browser''s view. Do i have to run rake:db migrate everytime i create a new request? -- Posted via http://www.ruby-forum.com/. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
On 2 July 2012 22:15, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > I have a rails app. upon creating a new record from the browser(although > it is being created successfully) it doesnt show up in the browsers > view. Connecting to the DB , i confirmed that the record is created. I > should do a "Rake db:migrate" inorder to make the record appear on the > browser''s view. Do i have to run rake:db migrate everytime i create a > new request?No, of course not. You only need to run rake db:migrate when you have a new migration to run. It is impossible for someone here to know the answer to your problem when you have given so little data. Have a look at the rails guide on debugging to get ideas on how to debug your code so you can identify where the problem is arising and if you still cannot work out why the new record does not appear then ask again. Have you worked right through a tutorial such as railstutorial.org? If so then when you added a new record to a table there did it appear in the view? If it did, but in your app it does not, then try to work out what the difference is between your code and similar code in the demo in the tutorial. Colin -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Hi Colin, Thanks for the response . I have spent enough time debugging my rails app and found that the default code generated by the rails itself is buggy. I have created a new scaffold for the resource Trial. After creating a new entry, the index page of the resource shows up stale data. (I start creating a new record, i get a message record created successfully, only to see that the index page doesnt show up any record). I had put up print statement in the controller index and saw that the statement "@trails = Trial.all" returns nothing. But if i do a "rake db:migrate" (which i dont have to do) the updated data shows up. Any help on this is greatly appreciated. Please let me know if you need any info. Im using rails version 3.2.4 My class controller Class TrialsController < ApplicationController # GET /trials # GET /trials.json def index @trials = Trial.all respond_to do |format| format.html # index.html.erb format.json { render :json => @trials } end end # GET /trials/1 # GET /trials/1.json def show @trial = Trial.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render :json => @trial } end end # GET /trials/new # GET /trials/new.json def new @trial = Trial.new respond_to do |format| format.html # new.html.erb format.json { render :json => @trial } end end # GET /trials/1/edit def edit @trial = Trial.find(params[:id]) end # POST /trials # POST /trials.json def create @trial = Trial.new(params[:trial]) respond_to do |format| if @trial.save format.html { redirect_to @trial, :notice => ''Trial was successfully created.'' } format.json { render :json => @trial, :status => :created, :location => @trial } else format.html { render :action => "new" } format.json { render :json => @trial.errors, :status => :unprocessable_entity } end end end # PUT /trials/1 # PUT /trials/1.json def update @trial = Trial.find(params[:id]) respond_to do |format| if @trial.update_attributes(params[:trial]) format.html { redirect_to @trial, :notice => ''Trial was successfully updated.'' } format.json { head :no_content } else format.html { render :action => "edit" } format.json { render :json => @trial.errors, :status => :unprocessable_entity } end end end # DELETE /trials/1 # DELETE /trials/1.json def destroy @trial = Trial.find(params[:id]) @trial.destroy respond_to do |format| format.html { redirect_to trials_url } format.json { head :no_content } end end end -- Posted via http://www.ruby-forum.com/. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Colin Law
2012-Jul-04 07:39 UTC
Re: Re: Creating a new record doesnt update the browser view
On 4 July 2012 01:35, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi Colin,Please remember to quote the previous post when replying, I have just had to look back at the previous email to find what I suggested last time. This is a mailing list not a forum, though you may be accessing it via a forum style interface.> > Thanks for the response . I have spent enough time debugging my rails > app and found that the default code generated by the rails itself is > buggy. > I have created a new scaffold for the resource Trial. After > creating a new entry, the index page of the resource shows up stale > data. (I start creating a new record, i get a message record created > successfully, only to see that the index page doesnt show up any > record). I had put up print statement in the controller index and saw > that the statement "@trails = Trial.all" returns nothing.Did you mean @trials rather then @trails?> But if i do a > "rake db:migrate" (which i dont have to do) the updated data shows up.Have a look in development.log to see if there are any clues there. If you can''t see anything post the section of the log starting with the GET for trials/new, through the create and ending with the index request. Colin> > Any help on this is greatly appreciated. Please let me know if you need > any info. > > Im using rails version 3.2.4 > My class controller > > Class TrialsController < ApplicationController > # GET /trials > # GET /trials.json > def index > @trials = Trial.all > > respond_to do |format| > format.html # index.html.erb > format.json { render :json => @trials } > end > end > > # GET /trials/1 > # GET /trials/1.json > def show > @trial = Trial.find(params[:id]) > > respond_to do |format| > format.html # show.html.erb > format.json { render :json => @trial } > end > end > > # GET /trials/new > # GET /trials/new.json > def new > @trial = Trial.new > > respond_to do |format| > format.html # new.html.erb > format.json { render :json => @trial } > end > end > > # GET /trials/1/edit > def edit > @trial = Trial.find(params[:id]) > end > > # POST /trials > # POST /trials.json > def create > @trial = Trial.new(params[:trial]) > > respond_to do |format| > if @trial.save > format.html { redirect_to @trial, :notice => ''Trial was > successfully created.'' } > format.json { render :json => @trial, :status => :created, > :location => @trial } > else > format.html { render :action => "new" } > format.json { render :json => @trial.errors, :status => > :unprocessable_entity } > > end > end > end > > # PUT /trials/1 > # PUT /trials/1.json > def update > @trial = Trial.find(params[:id]) > > respond_to do |format| > if @trial.update_attributes(params[:trial]) > format.html { redirect_to @trial, :notice => ''Trial was > successfully updated.'' } > format.json { head :no_content } > else > format.html { render :action => "edit" } > format.json { render :json => @trial.errors, :status => > :unprocessable_entity } > end > end > end > > # DELETE /trials/1 > # DELETE /trials/1.json > def destroy > @trial = Trial.find(params[:id]) > @trial.destroy > > respond_to do |format| > format.html { redirect_to trials_url } > format.json { head :no_content } > end > end > end > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US. >-- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
>> Hi Colin,>Please remember to quote the previous post when replying, I have just >had to look back at the previous email to find what I suggested last >time. This is a mailing list not a forum, though you may be accessing >it via a forum style interface.>> >>Thanks for the response . I have spent enough time debugging my rails >> app and found that the default code generated by the rails itself is >> buggy. >> I have created a new scaffold for the resource Trial. After >> creating a new entry, the index page of the resource shows up stale >> data. (I start creating a new record, i get a message record created >> successfully, only to see that the index page doesnt show up any >> record). I had put up print statement in the controller index and saw >> that the statement "@trails = Trial.all" returns nothing.>Did you mean @trials rather then @trails?Yes I meant trials>> But if i do a >>"rake db:migrate" (which i dont have to do) the updated data shows up.>Have a look in development.log to see if there are any clues there. >If you can''t see anything post the section of the log starting with >the GET for trials/new, through the create and ending with the index >request.>ColinI looked at the development.log , but couldn''t find any useful info. Here is the log for your reference Started GET "/trials/new" for 127.0.0.1 at Thu Jul 05 10:26:03 -0700 2012 Processing by TrialsController#new as HTML Rendered trials/_form.html.erb (19.9ms) Rendered trials/new.html.erb within layouts/application (21.3ms) Completed 200 OK in 37ms (Views: 36.9ms | ActiveRecord: 0.0ms) Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 10:26:03 -0700 2012 Served asset /trials.css - 304 Not Modified (0ms) Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 10:26:03 -0700 2012 Served asset /trials.js - 304 Not Modified (0ms) Started POST "/trials" for 127.0.0.1 at Thu Jul 05 10:26:19 -0700 2012 Processing by TrialsController#create as HTML Parameters: {"commit"=>"Create Trial", "trial"=>{"name"=>"ruby", "email"=>"ror-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org"}, "authenticity_token"=>"cDA9t9ShPJPyZAOQH8rlXS038tLGJGCE9nItrHrD8JA=", "utf8"=>"✓"} (0.1ms) begin transaction SQL (1.5ms) INSERT INTO "trials" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Thu, 05 Jul 2012 17:26:19 UTC +00:00], ["email", "ror-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org"], ["name", "ruby"], ["updated_at", Thu, 05 Jul 2012 17:26:19 UTC +00:00]] (1.2ms) commit transaction Redirected to http://localhost:3001/trials/2 Completed 302 Found in 9ms (ActiveRecord: 2.8ms) Started GET "/trials/2" for 127.0.0.1 at Thu Jul 05 10:26:19 -0700 2012 Processing by TrialsController#show as HTML Parameters: {"id"=>"2"} Trial Load (0.2ms) SELECT "trials".* FROM "trials" WHERE "trials"."id" = ? LIMIT 1 [["id", "2"]] Rendered trials/show.html.erb within layouts/application (1.1ms) Completed 200 OK in 39ms (Views: 37.9ms | ActiveRecord: 0.2ms) Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 10:26:19 -0700 2012 Served asset /trials.js - 304 Not Modified (0ms) Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 10:26:19 -0700 2012 Served asset /trials.css - 304 Not Modified (0ms) Started GET "/trials" for 127.0.0.1 at Thu Jul 05 10:26:45 -0700 2012 Processing by TrialsController#index as HTML Rendered trials/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms) Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 10:26:45 -0700 2012 Served asset /trials.css - 304 Not Modified (0ms) Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 10:26:45 -0700 2012 Served asset /trials.js - 304 Not Modified (0ms) The last request "GET /trials" renders only the old records and not the new record that i have just created. Please letme know if you understand what''s happening in this case. -- Posted via http://www.ruby-forum.com/. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Colin Law
2012-Jul-05 19:49 UTC
Re: Re: Creating a new record doesnt update the browser view
On 5 July 2012 18:32, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>>> Hi Colin, > >>Please remember to quote the previous post when replying, I have just >>had to look back at the previous email to find what I suggested last >>time. This is a mailing list not a forum, though you may be accessing >>it via a forum style interface. > >>> >>>Thanks for the response . I have spent enough time debugging my rails >>> app and found that the default code generated by the rails itself is >>> buggy. >>> I have created a new scaffold for the resource Trial. After >>> creating a new entry, the index page of the resource shows up stale >>> data. (I start creating a new record, i get a message record created >>> successfully, only to see that the index page doesnt show up any >>> record). I had put up print statement in the controller index and saw >>> that the statement "@trails = Trial.all" returns nothing. > >>Did you mean @trials rather then @trails? > > Yes I meant trials > >>> But if i do a >>>"rake db:migrate" (which i dont have to do) the updated data shows up. > >>Have a look in development.log to see if there are any clues there. >>If you can''t see anything post the section of the log starting with >>the GET for trials/new, through the create and ending with the index >>request. > >>Colin > > > I looked at the development.log , but couldn''t find any useful info. > Here is the log for your reference > > Started GET "/trials/new" for 127.0.0.1 at Thu Jul 05 10:26:03 -0700 > 2012 > Processing by TrialsController#new as HTML > Rendered trials/_form.html.erb (19.9ms) > Rendered trials/new.html.erb within layouts/application (21.3ms) > Completed 200 OK in 37ms (Views: 36.9ms | ActiveRecord: 0.0ms) > > > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 > 10:26:03 -0700 2012 > Served asset /trials.css - 304 Not Modified (0ms) > > > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 > 10:26:03 -0700 2012 > Served asset /trials.js - 304 Not Modified (0ms) > > > Started POST "/trials" for 127.0.0.1 at Thu Jul 05 10:26:19 -0700 2012 > Processing by TrialsController#create as HTML > Parameters: {"commit"=>"Create Trial", "trial"=>{"name"=>"ruby", > "email"=>"ror-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org"}, > "authenticity_token"=>"cDA9t9ShPJPyZAOQH8rlXS038tLGJGCE9nItrHrD8JA=", > "utf8"=>"✓"} > (0.1ms) begin transaction > SQL (1.5ms) INSERT INTO "trials" ("created_at", "email", "name", > "updated_at") VALUES (?, ?, ?, ?) [["created_at", Thu, 05 Jul 2012 > 17:26:19 UTC +00:00], ["email", "ror-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org"], ["name", "ruby"], > ["updated_at", Thu, 05 Jul 2012 17:26:19 UTC +00:00]] > (1.2ms) commit transaction > Redirected to http://localhost:3001/trials/2 > Completed 302 Found in 9ms (ActiveRecord: 2.8ms) > > > Started GET "/trials/2" for 127.0.0.1 at Thu Jul 05 10:26:19 -0700 2012 > Processing by TrialsController#show as HTML > Parameters: {"id"=>"2"} > Trial Load (0.2ms) SELECT "trials".* FROM "trials" WHERE > "trials"."id" = ? LIMIT 1 [["id", "2"]] > Rendered trials/show.html.erb within layouts/application (1.1ms) > Completed 200 OK in 39ms (Views: 37.9ms | ActiveRecord: 0.2ms) > > > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 > 10:26:19 -0700 2012 > Served asset /trials.js - 304 Not Modified (0ms) > > > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 > 10:26:19 -0700 2012 > Served asset /trials.css - 304 Not Modified (0ms) > > > Started GET "/trials" for 127.0.0.1 at Thu Jul 05 10:26:45 -0700 2012 > Processing by TrialsController#index as HTML > Rendered trials/index.html.erb within layouts/application (1.2ms) > Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms) > > > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 > 10:26:45 -0700 2012 > Served asset /trials.css - 304 Not Modified (0ms) > > > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 > 10:26:45 -0700 2012 > Served asset /trials.js - 304 Not Modified (0ms) > > > The last request "GET /trials" renders only the old records and not the > new record that i have just created.There should be some sql fetching the records for the index view. It seems it has not fetched the records at all. Can you post index.html.erb. Copy/Paste it obviously. If it is large then use pastebin.com or similar. Colin -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
>>> buggy. >> >> >> >> Started POST "/trials" for 127.0.0.1 at Thu Jul 05 10:26:19 -0700 2012 >> (1.2ms) commit transaction >> Completed 200 OK in 39ms (Views: 37.9ms | ActiveRecord: 0.2ms) >> >> >> >> Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 >> 10:26:45 -0700 2012 >> Served asset /trials.js - 304 Not Modified (0ms) >> >> >> >> The last request "GET /trials" renders only the old records and not the >> new record that i have just created.>There should be some sql fetching the records for the index view. It >seems it has not fetched the records at all. Can you post >index.html.erb. Copy/Paste it obviously. If it is large then use >pastebin.com or similar.Index.html.erb : <h1>Listing trials</h1> <table> <tr> <th>Name</th> <th>Email</th> <th></th> <th></th> <th></th> </tr> <% @trials.each do |trial| %> <tr> <td><%= trial.name %></td> <td><%= trial.email %></td> <td><%= link_to ''Show'', trial %></td> <td><%= link_to ''Edit'', edit_trial_path(trial) %></td> <td><%= link_to ''Destroy'', trial, :confirm => ''Are you sure?'', :method => :delete %></td> </tr> <% end %> </table> <br /> <%= link_to ''New Trial'', new_trial_path %> -- Posted via http://www.ruby-forum.com/. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Colin Law
2012-Jul-05 20:59 UTC
Re: Re: Creating a new record doesnt update the browser view
On 5 July 2012 21:37, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>>>> buggy. >>> >>> >>> >>> Started POST "/trials" for 127.0.0.1 at Thu Jul 05 10:26:19 -0700 2012 >>> (1.2ms) commit transaction >>> Completed 200 OK in 39ms (Views: 37.9ms | ActiveRecord: 0.2ms) >>> >>> >>> >>> Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 >>> 10:26:45 -0700 2012 >>> Served asset /trials.js - 304 Not Modified (0ms) >>> >>> >>> >>> The last request "GET /trials" renders only the old records and not the >>> new record that i have just created. > >>There should be some sql fetching the records for the index view. It >>seems it has not fetched the records at all. Can you post >>index.html.erb. Copy/Paste it obviously. If it is large then use >>pastebin.com or similar. > > Index.html.erb : > > <h1>Listing trials</h1>Change the above line to <h1>Listing trials: count = <%= trials.count %></h1>> > <table> > <tr> > <th>Name</th> > <th>Email</th> > <th></th> > <th></th> > <th></th> > </tr> > > <% @trials.each do |trial| %> > <tr> > <td><%= trial.name %></td> > <td><%= trial.email %></td> > <td><%= link_to ''Show'', trial %></td> > <td><%= link_to ''Edit'', edit_trial_path(trial) %></td> > <td><%= link_to ''Destroy'', trial, :confirm => ''Are you sure?'', > :method => :delete %></td> > </tr> > <% end %> > </table> > > <br /> > > <%= link_to ''New Trial'', new_trial_path %>Now run the app, bring up the index and note the count shown (what is it and how many records do you see), add a record and then show the index again. Does the count change? Post the log for that complete cycle. If the test is still not showing the new records what happens if you restart the rails server and then show the index? One further point, I find it surprising that the id of the new record is 2. After all this messing about adding records there should be lots there. How many are there? Colin -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
>Now run the app, bring up the index and note the count shown (what is >it and how many records do you see), add a record and then show the >index again. Does the count change? Post the log for that complete >cycle.The count shown is old , doesnt include the newly created one. Started GET "/trials/new" for 127.0.0.1 at Thu Jul 05 15:22:17 -0700 2012 Processing by TrialsController#new as HTML Rendered trials/_form.html.erb (43.9ms) Rendered trials/new.html.erb within layouts/application (54.3ms) Completed 200 OK in 90ms (Views: 88.9ms | ActiveRecord: 0.0ms) Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 15:22:17 -0700 2012 Served asset /trials.css - 304 Not Modified (0ms) Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 15:22:17 -0700 2012 Served asset /trials.js - 304 Not Modified (0ms) Started POST "/trials" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 Processing by TrialsController#create as HTML Parameters: {"commit"=>"Create Trial", "authenticity_token"=>"cDA9t9ShPJPyZAOQH8rlXS038tLGJGCE9nItrHrD8JA=", "trial"=>{"name"=>"python", "email"=>"me-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"}, "utf8"=>"✓"} ^[[1m^[[35m (0.1ms)^[[0m begin transaction ^[[1m^[[36mSQL (31.6ms)^[[0m ^[[1mINSERT INTO "trials" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?)^[[0m [["created_at", Thu, 05 Jul 2012 22:22:41 UTC +00:00], ["email", "me-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"], ["name", "python"], ["up ^[[1m^[[35m (1.2ms)^[[0m commit transaction Redirected to http://localhost:3001/trials/3 Completed 302 Found in 40ms (ActiveRecord: 32.9ms) Started GET "/trials/3" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 Processing by TrialsController#show as HTML Parameters: {"id"=>"3"} ^[[1m^[[36mTrial Load (0.3ms)^[[0m ^[[1mSELECT "trials".* FROM "trials" WHERE "trials"."id" = ? LIMIT 1^[[0m [["id", "3"]] Rendered trials/show.html.erb within layouts/application (2.6ms) Completed 200 OK in 29ms (Views: 25.7ms | ActiveRecord: 0.3ms) Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 Served asset /trials.css - 304 Not Modified (0ms) Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 Served asset /trials.js - 304 Not Modified (0ms) Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:22:43 -0700 2012 Processing by TrialsController#index as HTML Rendered trials/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 11ms (Views: 11.0ms | ActiveRecord: 0.0ms) Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 15:22:43 -0700 2012 Served asset /trials.css - 304 Not Modified (0ms) Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 15:22:43 -0700 2012 Served asset /trials.js - 304 Not Modified (0ms) Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:22:48 -0700 2012 Processing by TrialsController#index as HTML Rendered trials/index.html.erb within layouts/application (3.4ms) Completed 200 OK in 15ms (Views: 14.6ms | ActiveRecord: 0.0ms) Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 15:22:48 -0700 2012 Served asset /trials.js - 304 Not Modified (0ms) Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 15:22:48 -0700 2012 Served asset /trials.css - 304 Not Modified (0ms)> If the test is still not showing the new records what happens if yourestart the rails server and then show the index? I see the newer count (expected) once i restart the server log: Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:27:08 -0700 2012 Connecting to database specified by database.yml Processing by TrialsController#index as HTML Trial Load (0.1ms) SELECT "trials".* FROM "trials" Rendered trials/index.html.erb within layouts/application (7.2ms) Completed 200 OK in 94ms (Views: 72.9ms | ActiveRecord: 1.3ms) Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 15:27:08 -0700 2012 Served asset /trials.css - 304 Not Modified (2ms) Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 15:27:08 -0700 2012 Served asset /trials.js - 304 Not Modified (2ms)>One further point, I find it surprising that the id of the new recordis 2. After all this messing about adding records there should be lots there. How many are there? I started with a new table and hence there are very few records :) -- Posted via http://www.ruby-forum.com/. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Colin Law
2012-Jul-06 08:07 UTC
Re: Re: Creating a new record doesnt update the browser view
On 5 July 2012 23:29, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>>Now run the app, bring up the index and note the count shown (what is >>it and how many records do you see), add a record and then show the >>index again. Does the count change? Post the log for that complete >>cycle. > > > The count shown is old , doesnt include the newly created one. > > > Started GET "/trials/new" for 127.0.0.1 at Thu Jul 05 15:22:17 -0700 > 2012 > Processing by TrialsController#new as HTML > Rendered trials/_form.html.erb (43.9ms) > Rendered trials/new.html.erb within layouts/application (54.3ms) > Completed 200 OK in 90ms (Views: 88.9ms | ActiveRecord: 0.0ms) > > > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 > 15:22:17 -0700 2012 > Served asset /trials.css - 304 Not Modified (0ms) > > > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 > 15:22:17 -0700 2012 > Served asset /trials.js - 304 Not Modified (0ms) > > > Started POST "/trials" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 > Processing by TrialsController#create as HTML > Parameters: {"commit"=>"Create Trial", > "authenticity_token"=>"cDA9t9ShPJPyZAOQH8rlXS038tLGJGCE9nItrHrD8JA=", > "trial"=>{"name"=>"python", "email"=>"me-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"}, "utf8"=>"✓"} > ^[[1m^[[35m (0.1ms)^[[0m begin transaction > ^[[1m^[[36mSQL (31.6ms)^[[0m ^[[1mINSERT INTO "trials" ("created_at", > "email", "name", "updated_at") VALUES (?, ?, ?, ?)^[[0m [["created_at", > Thu, 05 Jul 2012 22:22:41 UTC +00:00], ["email", "me-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"], > ["name", "python"], ["up > ^[[1m^[[35m (1.2ms)^[[0m commit transaction > Redirected to http://localhost:3001/trials/3 > Completed 302 Found in 40ms (ActiveRecord: 32.9ms) > > > Started GET "/trials/3" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 > Processing by TrialsController#show as HTML > Parameters: {"id"=>"3"} > ^[[1m^[[36mTrial Load (0.3ms)^[[0m ^[[1mSELECT "trials".* FROM > "trials" WHERE "trials"."id" = ? LIMIT 1^[[0m [["id", "3"]] > Rendered trials/show.html.erb within layouts/application (2.6ms) > Completed 200 OK in 29ms (Views: 25.7ms | ActiveRecord: 0.3ms) > > > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 > 15:22:41 -0700 2012 > Served asset /trials.css - 304 Not Modified (0ms) > > > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 > 15:22:41 -0700 2012 > Served asset /trials.js - 304 Not Modified (0ms) > > > Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:22:43 -0700 2012 > Processing by TrialsController#index as HTML > Rendered trials/index.html.erb within layouts/application (2.8ms) > Completed 200 OK in 11ms (Views: 11.0ms | ActiveRecord: 0.0ms)Once again note that there is no sql showing the trials being fetched> ... > I see the newer count (expected) once i restart the server > > log: > > Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:27:08 -0700 2012 > Connecting to database specified by database.yml > Processing by TrialsController#index as HTML > Trial Load (0.1ms) SELECT "trials".* FROM "trials" > Rendered trials/index.html.erb within layouts/application (7.2ms) > Completed 200 OK in 94ms (Views: 72.9ms | ActiveRecord: 1.3ms)Here we /do/ see the sql fetching the records. Very odd. There must be something going wrong with the caching. Have you changed anything in the the config directory other than database.yml and routes.rb? Specifically environment.rb or anything in config/environments? Are you including any gems that might be relevant? Post database.yml and the result of gem list Has anyone else seen this situation before? Colin -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
On Friday, July 6, 2012 4:07:11 AM UTC-4, Colin Law wrote:> > On 5 July 2012 23:29, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >>Now run the app, bring up the index and note the count shown (what is > >>it and how many records do you see), add a record and then show the > >>index again. Does the count change? Post the log for that complete > >>cycle. > > > > > > The count shown is old , doesnt include the newly created one. > > > > > > Started GET "/trials/new" for 127.0.0.1 at Thu Jul 05 15:22:17 -0700 > > 2012 > > Processing by TrialsController#new as HTML > > Rendered trials/_form.html.erb (43.9ms) > > Rendered trials/new.html.erb within layouts/application (54.3ms) > > Completed 200 OK in 90ms (Views: 88.9ms | ActiveRecord: 0.0ms) > > > > > > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 > > 15:22:17 -0700 2012 > > Served asset /trials.css - 304 Not Modified (0ms) > > > > > > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 > > 15:22:17 -0700 2012 > > Served asset /trials.js - 304 Not Modified (0ms) > > > > > > Started POST "/trials" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 > > Processing by TrialsController#create as HTML > > Parameters: {"commit"=>"Create Trial", > > "authenticity_token"=>"cDA9t9ShPJPyZAOQH8rlXS038tLGJGCE9nItrHrD8JA=", > > "trial"=>{"name"=>"python", "email"=>"me-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"}, "utf8"=>"✓"} > > ^[[1m^[[35m (0.1ms)^[[0m begin transaction > > ^[[1m^[[36mSQL (31.6ms)^[[0m ^[[1mINSERT INTO "trials" ("created_at", > > "email", "name", "updated_at") VALUES (?, ?, ?, ?)^[[0m [["created_at", > > Thu, 05 Jul 2012 22:22:41 UTC +00:00], ["email", "me-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"], > > ["name", "python"], ["up > > ^[[1m^[[35m (1.2ms)^[[0m commit transaction > > Redirected to http://localhost:3001/trials/3 > > Completed 302 Found in 40ms (ActiveRecord: 32.9ms) > > > > > > Started GET "/trials/3" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 > > Processing by TrialsController#show as HTML > > Parameters: {"id"=>"3"} > > ^[[1m^[[36mTrial Load (0.3ms)^[[0m ^[[1mSELECT "trials".* FROM > > "trials" WHERE "trials"."id" = ? LIMIT 1^[[0m [["id", "3"]] > > Rendered trials/show.html.erb within layouts/application (2.6ms) > > Completed 200 OK in 29ms (Views: 25.7ms | ActiveRecord: 0.3ms) > > > > > > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 > > 15:22:41 -0700 2012 > > Served asset /trials.css - 304 Not Modified (0ms) > > > > > > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 > > 15:22:41 -0700 2012 > > Served asset /trials.js - 304 Not Modified (0ms) > > > > > > Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:22:43 -0700 2012 > > Processing by TrialsController#index as HTML > > Rendered trials/index.html.erb within layouts/application (2.8ms) > > Completed 200 OK in 11ms (Views: 11.0ms | ActiveRecord: 0.0ms) > > Once again note that there is no sql showing the trials being fetched > > > ... > > I see the newer count (expected) once i restart the server > > > > log: > > > > Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:27:08 -0700 2012 > > Connecting to database specified by database.yml > > Processing by TrialsController#index as HTML > > Trial Load (0.1ms) SELECT "trials".* FROM "trials" > > Rendered trials/index.html.erb within layouts/application (7.2ms) > > Completed 200 OK in 94ms (Views: 72.9ms | ActiveRecord: 1.3ms) > > Here we /do/ see the sql fetching the records. Very odd. There must > be something going wrong with the caching. Have you changed anything > in the the config directory other than database.yml and routes.rb? > Specifically environment.rb or anything in config/environments? Are > you including any gems that might be relevant? > > Post database.yml and the result of > gem list > > Has anyone else seen this situation before? > > If, after you create a new record in your database, you just use thebrowser''s back button (or delete) to go back in history to your original index you will not see the new data. To demonstrate this just use: *1> rails new demonstrate 2> cd demonstrate 3> rails scaffold User name:string 4> rake db:create 5> rake db:migrate 6> rails server* Then in your browser go to *localhost:3000/users* and create a new user. Then just use the browser''s* *history to go back to the view of the (empty) index at *localhost:3000/users* - you''ll notice it''s still empty. If instead of the browser''s history you use the *Back* link provided on the page displayed after the successful creation of the new user, you''ll see the new entry displayed in the index. Also, if you start another browser (say Safari if you''re currently using Firefox) on your local system and point it at *localhost:3000/users* Safari will not track changes you make in Firefox even if you use the *Bake* link provided by rails and get your Firefox index refreshed. Rick> Colin >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/UoLaqlnKPecJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Clint Laskowski
2012-Jul-06 13:50 UTC
Re: Re: Creating a new record doesnt update the browser view
I think you missed the "generate" or "g" command in line 3. Shouldn''t it read: 3> rails generate scaffold User name:string Thanks. -- Clint *Clint Laskowski, CISSP, CISM* email: clint.laskowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org blog: http://www.tek414.com << new! project: http://Signup.StartupWeekendMilwaukee.org << sign up twitter: @Clint326 <http://twitter.com/clint326> On Fri, Jul 6, 2012 at 8:37 AM, Rick <richard.t.lloyd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Friday, July 6, 2012 4:07:11 AM UTC-4, Colin Law wrote: >> >> On 5 July 2012 23:29, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >>Now run the app, bring up the index and note the count shown (what is >> >>it and how many records do you see), add a record and then show the >> >>index again. Does the count change? Post the log for that complete >> >>cycle. >> > >> > >> > The count shown is old , doesnt include the newly created one. >> > >> > >> > Started GET "/trials/new" for 127.0.0.1 at Thu Jul 05 15:22:17 -0700 >> > 2012 >> > Processing by TrialsController#new as HTML >> > Rendered trials/_form.html.erb (43.9ms) >> > Rendered trials/new.html.erb within layouts/application (54.3ms) >> > Completed 200 OK in 90ms (Views: 88.9ms | ActiveRecord: 0.0ms) >> > >> > >> > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 >> > 15:22:17 -0700 2012 >> > Served asset /trials.css - 304 Not Modified (0ms) >> > >> > >> > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 >> > 15:22:17 -0700 2012 >> > Served asset /trials.js - 304 Not Modified (0ms) >> > >> > >> > Started POST "/trials" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 >> > Processing by TrialsController#create as HTML >> > Parameters: {"commit"=>"Create Trial", >> > "authenticity_token"=>"**cDA9t9ShPJPyZAOQH8rlXS038tLGJG**CE9nItrHrD8JA=", >> >> > "trial"=>{"name"=>"python", "email"=>"me-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"}, "utf8"=>"✓"} >> > ^[[1m^[[35m (0.1ms)^[[0m begin transaction >> > ^[[1m^[[36mSQL (31.6ms)^[[0m ^[[1mINSERT INTO "trials" >> ("created_at", >> > "email", "name", "updated_at") VALUES (?, ?, ?, ?)^[[0m >> [["created_at", >> > Thu, 05 Jul 2012 22:22:41 UTC +00:00], ["email", "me-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"], >> > ["name", "python"], ["up >> > ^[[1m^[[35m (1.2ms)^[[0m commit transaction >> > Redirected to http://localhost:3001/trials/3 >> > Completed 302 Found in 40ms (ActiveRecord: 32.9ms) >> > >> > >> > Started GET "/trials/3" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 >> > Processing by TrialsController#show as HTML >> > Parameters: {"id"=>"3"} >> > ^[[1m^[[36mTrial Load (0.3ms)^[[0m ^[[1mSELECT "trials".* FROM >> > "trials" WHERE "trials"."id" = ? LIMIT 1^[[0m [["id", "3"]] >> > Rendered trials/show.html.erb within layouts/application (2.6ms) >> > Completed 200 OK in 29ms (Views: 25.7ms | ActiveRecord: 0.3ms) >> > >> > >> > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 >> > 15:22:41 -0700 2012 >> > Served asset /trials.css - 304 Not Modified (0ms) >> > >> > >> > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 >> > 15:22:41 -0700 2012 >> > Served asset /trials.js - 304 Not Modified (0ms) >> > >> > >> > Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:22:43 -0700 2012 >> > Processing by TrialsController#index as HTML >> > Rendered trials/index.html.erb within layouts/application (2.8ms) >> > Completed 200 OK in 11ms (Views: 11.0ms | ActiveRecord: 0.0ms) >> >> Once again note that there is no sql showing the trials being fetched >> >> > ... >> > I see the newer count (expected) once i restart the server >> > >> > log: >> > >> > Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:27:08 -0700 2012 >> > Connecting to database specified by database.yml >> > Processing by TrialsController#index as HTML >> > Trial Load (0.1ms) SELECT "trials".* FROM "trials" >> > Rendered trials/index.html.erb within layouts/application (7.2ms) >> > Completed 200 OK in 94ms (Views: 72.9ms | ActiveRecord: 1.3ms) >> >> Here we /do/ see the sql fetching the records. Very odd. There must >> be something going wrong with the caching. Have you changed anything >> in the the config directory other than database.yml and routes.rb? >> Specifically environment.rb or anything in config/environments? Are >> you including any gems that might be relevant? >> >> Post database.yml and the result of >> gem list >> >> Has anyone else seen this situation before? >> >> If, after you create a new record in your database, you just use the > browser''s back button (or delete) to go back in history to your original > index you will not see the new data. > > To demonstrate this just use: > > *1> rails new demonstrate > 2> cd demonstrate > 3> rails scaffold User name:string > 4> rake db:create > 5> rake db:migrate > 6> rails server* > > Then in your browser go to *localhost:3000/users* and create a new user. > Then just use the browser''s* *history to go back to the view of the > (empty) index at *localhost:3000/users* - you''ll notice it''s still empty. > > If instead of the browser''s history you use the *Back* link provided on > the page displayed after the successful creation of the new user, you''ll > see the new entry displayed in the index. > > Also, if you start another browser (say Safari if you''re currently using > Firefox) on your local system and point it at *localhost:3000/users*Safari will not track changes you make in Firefox even if you use the > *Bake* link provided by rails and get your Firefox index refreshed. > > Rick > >> Colin >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/UoLaqlnKPecJ. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en-US. >-- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Hi Colin,>Here we /do/ see the sql fetching the records. Very odd. There must >be something going wrong with the caching. Have you changed anything >in the the config directory other than database.yml and routes.rb? >Specifically environment.rb or anything in config/environments? Are >you including any gems that might be relevant?No i havent changed anything here. Just to remove any local changes i might have made, i am posting data from a newly created rails app. routes.rb FirstApp::Application.routes.draw do resources :trials get "say/hello" get "say/goodbye" end>Post database.yml and the result of# SQLite version 3.x # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile # gem ''sqlite3'' development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000>gem list*** LOCAL GEMS *** actionmailer (3.2.4, 3.2.3) actionpack (3.2.4, 3.2.3) activemodel (3.2.6, 3.2.4, 3.2.3) activerecord (3.2.4, 3.2.3) activeresource (3.2.6, 3.2.4, 3.2.3) activesupport (3.2.6, 3.2.4, 3.2.3) arel (3.0.2) builder (3.0.0) bundler (1.1.4) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.3.3) columnize (0.3.6) console (0.5) dynamic_form (1.1.4) erubis (2.7.0) execjs (1.4.0) hike (1.2.1) i18n (0.6.0) journey (1.0.3) jquery-rails (2.0.2) json (1.7.3) linecache (0.46) mail (2.4.4) mime-types (1.18) multi_json (1.3.6) mysql (2.8.1) mysql2 (0.3.11) nokogiri (1.5.4) open4 (1.3.0) OptionParser (0.5.1) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) rack-ssl (1.3.2) rack-test (0.6.1) rails (3.2.4, 3.2.3) railties (3.2.4, 3.2.3) rake (0.9.2.2) rbx-require-relative (0.0.9) rdoc (3.12) ruby-debug (0.10.4) ruby-debug-base (0.10.4) rubygems-update (1.8.24, 1.8.1) sass (3.1.19) sass-rails (3.2.5) sprockets (2.1.3) sqlite3 (1.3.6, 1.3.5) thor (0.15.2, 0.14.6) tilt (1.3.3) treetop (1.4.10) tzinfo (0.3.33) uglifier (1.2.4) yajl-ruby (1.1.0) -- Posted via http://www.ruby-forum.com/. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Colin Law
2012-Jul-06 19:20 UTC
Re: Re: Creating a new record doesnt update the browser view
On 6 July 2012 17:58, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi Colin, > > >>Here we /do/ see the sql fetching the records. Very odd. There must >>be something going wrong with the caching. Have you changed anything >>in the the config directory other than database.yml and routes.rb? >>Specifically environment.rb or anything in config/environments? Are >>you including any gems that might be relevant? > > No i havent changed anything here. Just to remove any local changes i > might have made, i am posting data from a newly created rails app. > > routes.rb > FirstApp::Application.routes.draw do > resources :trials > > get "say/hello" > > get "say/goodbye" > > end > > >>Post database.yml and the result of > # SQLite version 3.x > # gem install sqlite3 > # > # Ensure the SQLite 3 gem is defined in your Gemfile > # gem ''sqlite3'' > development: > adapter: sqlite3 > database: db/development.sqlite3 > pool: 5 > timeout: 5000 > > # Warning: The database defined as "test" will be erased and > # re-generated from your development database when you run "rake". > # Do not set this db to the same as development or production. > test: > adapter: sqlite3 > database: db/test.sqlite3 > pool: 5 > timeout: 5000 > > production: > adapter: sqlite3 > database: db/production.sqlite3 > pool: 5 > timeout: 5000 > > >>gem list > > *** LOCAL GEMS *** > > actionmailer (3.2.4, 3.2.3) > actionpack (3.2.4, 3.2.3) > activemodel (3.2.6, 3.2.4, 3.2.3) > activerecord (3.2.4, 3.2.3) > activeresource (3.2.6, 3.2.4, 3.2.3) > activesupport (3.2.6, 3.2.4, 3.2.3)It is a bit suspicious that you have 3.2.6 of only some of these. I should have asked you to post Gemfile and Gemfile.lock too. Colin -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
>It is a bit suspicious that you have 3.2.6 of only some of these. Ishould have asked you to post Gemfile and Gemfile.lock too. Gemfile.lock GEM remote: https://rubygems.org/ specs: actionmailer (3.2.4) actionpack (= 3.2.4) mail (~> 2.4.4) actionpack (3.2.4) activemodel (= 3.2.4) activesupport (= 3.2.4) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.1) rack (~> 1.4.0) rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.1.3) activemodel (3.2.4) activesupport (= 3.2.4) builder (~> 3.0.0) activerecord (3.2.4) activemodel (= 3.2.4) activesupport (= 3.2.4) arel (~> 3.0.2) tzinfo (~> 0.3.29) activeresource (3.2.4) activemodel (= 3.2.4) activesupport (= 3.2.4) activesupport (3.2.4) i18n (~> 0.6) multi_json (~> 1.0) arel (3.0.2) builder (3.0.0) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) coffee-script (2.2.0) coffee-script-source execjs coffee-script-source (1.3.3) erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) hike (1.2.1) i18n (0.6.0) journey (1.0.3) jquery-rails (2.0.2) railties (>= 3.2.0, < 5.0) thor (~> 0.14) json (1.7.3) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.18) multi_json (1.3.6) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) rack (>= 0.4) rack-ssl (1.3.2) rack rack-test (0.6.1) rack (>= 1.0) rails (3.2.4) actionmailer (= 3.2.4) actionpack (= 3.2.4) activerecord (= 3.2.4) activeresource (= 3.2.4) activesupport (= 3.2.4) bundler (~> 1.0) railties (= 3.2.4) railties (3.2.4) actionpack (= 3.2.4) activesupport (= 3.2.4) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) rake (0.9.2.2) rdoc (3.12) json (~> 1.4) sass (3.1.19) sass-rails (3.2.5) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) sprockets (2.1.3) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.5) thor (0.15.2) tilt (1.3.3) treetop (1.4.10) polyglot polyglot (>= 0.3.1) tzinfo (0.3.33) uglifier (1.2.4) execjs (>= 0.3.0) multi_json (>= 1.0.2) PLATFORMS ruby DEPENDENCIES coffee-rails (~> 3.2.1) jquery-rails json rails (= 3.2.4) sass-rails (~> 3.2.3) sqlite3 (= 1.3.5) uglifier (>= 1.0.3) Gemfile source ''https://rubygems.org'' gem ''rails'', ''3.2.4'' # Bundle edge Rails instead: # gem ''rails'', :git => ''git://github.com/rails/rails.git'' group :development do gem ''sqlite3'', ''1.3.5'' end gem ''json'' # Gems used only for assets and not required # in production environments by default. group :assets do gem ''sass-rails'', ''~> 3.2.3'' gem ''coffee-rails'', ''~> 3.2.1'' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem ''therubyracer'', :platform => :ruby gem ''uglifier'', ''>= 1.0.3'' end gem ''jquery-rails'' # To use ActiveModel has_secure_password # gem ''bcrypt-ruby'', ''~> 3.0.0'' # To use Jbuilder templates for JSON # gem ''jbuilder'' # Use unicorn as the app server # gem ''unicorn'' # Deploy with Capistrano # gem ''capistrano'' # To use debugger # gem ''ruby-debug'' -- Posted via http://www.ruby-forum.com/. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Colin Law
2012-Jul-06 19:42 UTC
Re: Re: Creating a new record doesnt update the browser view
On 6 July 2012 20:33, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>>It is a bit suspicious that you have 3.2.6 of only some of these. I > should have asked you to post Gemfile and Gemfile.lock too. > > Gemfile.lock > > GEM > remote: https://rubygems.org/ > specs: > actionmailer (3.2.4) > actionpack (= 3.2.4) > mail (~> 2.4.4) > actionpack (3.2.4) > activemodel (= 3.2.4) > activesupport (= 3.2.4) > builder (~> 3.0.0) > erubis (~> 2.7.0) > journey (~> 1.0.1) > rack (~> 1.4.0) > rack-cache (~> 1.2) > rack-test (~> 0.6.1) > sprockets (~> 2.1.3) > activemodel (3.2.4) > activesupport (= 3.2.4) > builder (~> 3.0.0) > activerecord (3.2.4) > activemodel (= 3.2.4) > activesupport (= 3.2.4) > arel (~> 3.0.2) > tzinfo (~> 0.3.29) > activeresource (3.2.4) > activemodel (= 3.2.4) > activesupport (= 3.2.4) > activesupport (3.2.4) > i18n (~> 0.6) > multi_json (~> 1.0) > arel (3.0.2) > builder (3.0.0) > coffee-rails (3.2.2) > coffee-script (>= 2.2.0) > railties (~> 3.2.0) > coffee-script (2.2.0) > coffee-script-source > execjs > coffee-script-source (1.3.3) > erubis (2.7.0) > execjs (1.4.0) > multi_json (~> 1.0) > hike (1.2.1) > i18n (0.6.0) > journey (1.0.3) > jquery-rails (2.0.2) > railties (>= 3.2.0, < 5.0) > thor (~> 0.14) > json (1.7.3) > mail (2.4.4) > i18n (>= 0.4.0) > > mime-types (~> 1.16) > treetop (~> 1.4.8) > mime-types (1.18) > multi_json (1.3.6) > polyglot (0.3.3) > rack (1.4.1) > rack-cache (1.2) > rack (>= 0.4) > rack-ssl (1.3.2) > rack > rack-test (0.6.1) > rack (>= 1.0) > rails (3.2.4) > actionmailer (= 3.2.4) > actionpack (= 3.2.4) > activerecord (= 3.2.4) > activeresource (= 3.2.4) > activesupport (= 3.2.4) > bundler (~> 1.0) > railties (= 3.2.4) > railties (3.2.4) > actionpack (= 3.2.4) > activesupport (= 3.2.4) > rack-ssl (~> 1.3.2) > rake (>= 0.8.7) > rdoc (~> 3.4) > thor (>= 0.14.6, < 2.0) > rake (0.9.2.2) > rdoc (3.12) > json (~> 1.4) > sass (3.1.19) > sass-rails (3.2.5) > railties (~> 3.2.0) > sass (>= 3.1.10) > tilt (~> 1.3) > sprockets (2.1.3) > hike (~> 1.2) > rack (~> 1.0) > tilt (~> 1.1, != 1.3.0) > sqlite3 (1.3.5) > thor (0.15.2) > tilt (1.3.3) > treetop (1.4.10) > polyglot > polyglot (>= 0.3.1) > tzinfo (0.3.33) > uglifier (1.2.4) > execjs (>= 0.3.0) > multi_json (>= 1.0.2) > > PLATFORMS > ruby > > DEPENDENCIES > coffee-rails (~> 3.2.1) > jquery-rails > json > rails (= 3.2.4) > sass-rails (~> 3.2.3) > sqlite3 (= 1.3.5) > uglifier (>= 1.0.3) > > Gemfile > > > source ''https://rubygems.org'' > > gem ''rails'', ''3.2.4'' > > # Bundle edge Rails instead: > # gem ''rails'', :git => ''git://github.com/rails/rails.git'' > group :development do > gem ''sqlite3'', ''1.3.5'' > end > > gem ''json'' > > # Gems used only for assets and not required > # in production environments by default. > group :assets do > gem ''sass-rails'', ''~> 3.2.3'' > gem ''coffee-rails'', ''~> 3.2.1'' > > # See https://github.com/sstephenson/execjs#readme for more supported > runtimes > # gem ''therubyracer'', :platform => :ruby > > gem ''uglifier'', ''>= 1.0.3'' > end > > gem ''jquery-rails'' > > # To use ActiveModel has_secure_password > # gem ''bcrypt-ruby'', ''~> 3.0.0'' > > # To use Jbuilder templates for JSON > # gem ''jbuilder'' > > # Use unicorn as the app server > # gem ''unicorn'' > > # Deploy with Capistrano > # gem ''capistrano'' > > # To use debugger > # gem ''ruby-debug'' >Others have suggested that you might just be seeing caching in the browser as a result of using the back button in the browser, you presumably are not doing this, and have tried refreshing the page in the browser. Which browser are you using? Otherwise I am stumped. Colin -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Hi, I''m not using the back button , but refreshing the browser to see the updated list. I''m using Safari browser. Tried with a chrome too(from a windows machine, ofcourse my rails server is still running on my mac machine) and i see the same result. -- Posted via http://www.ruby-forum.com/. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.