hello, i want to create database for individual user . when user login and add sequences in to database .the web page show list of sequences that user have in database. but when i try show the list of of sequences .it''s show all list of sequence in database. such as the total sequences that user A add are 3 items and the total sequences that user B add are 5 items. when user A login and want to see own data .the web page show 8 items.in fact it''s show 3 items. how i fix this the problem.>>class ComponentsController < ApplicationControllerbefore_filter :protect, :only => [:show, :edit] def index @title = "list of sequences" @items = Seq.find(:all) end def databases @title = "Database" if request.post?and params[:seq] params[:seq][:sequence].gsub!(/\s/,"") params[:seq][:sequence].upcase! @seq = Seq.new(params[:seq]) if @seq.save flash[:notice] = "sequence submitted !" redirect_to :action => "show", :id => @seq.id end end end --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> def index > @title = "list of sequences" > @items = Seq.find(:all) > endThat method shouldn''t be doing a wide-open find. You need to scope the find somehow, and deal with the case where the current user isn''t logged in yet. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thank you for your suggestion . 2009/3/26 Ar Chron <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>> > > def index > > @title = "list of sequences" > > @items = Seq.find(:all) > > end > > That method shouldn''t be doing a wide-open find. You need to scope the > find somehow, and deal with the case where the current user isn''t logged > in yet. > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---