similar to: Some Basic Questions

Displaying 20 results from an estimated 2000 matches similar to: "Some Basic Questions"

2005 Mar 10
4
error messages, loops and saves, actionmailer and finaly authentication
Thanks to everyone who responded to my first set of questions. Not only did I get my questions answered but I improved my code and learned a couple new things. I think I prefer the mailing list over IRC... easier to follow :-) I have some more questions if you don''t mind. Some are Rails related and some are Ruby related. 1) This is concerning displaying error messages. I am assuming
2005 Mar 10
6
Expiring Cache Fragments and fcgi
First let me say that Rails caching is very very cool. The traffic (and responsiveness) I''ve saved by added 10 lines of ruby code would be enourmous, if I actually had traffic... ;) Sweepers as observers are great, btw. Since every page of my side is dynamic, once I did some DB optimization I''m caching the content of the index page which was taking the bulk of the time to load
2005 Mar 11
4
actionmailer settings
A couple questions: 1) How does rails no if you are in your test, dev or production environment? 2) Does anyone have an actionMailer server settings that will work on your standard local machine? I will use the one provided for my textdrive account but for testing on my machine I am getting connection refused. Thanks. Your Friend, Jonathan Kopanas http://www.kopanas.com
2005 Mar 10
7
Order of Processing
It seems odd to me that the layout is processesed after the view. When I set a variable inside the view it does not have an impact on the layout file. But when I set it in the controller it does. Is this the way it works or is it possible that I am doing something wrong?
2005 Mar 17
4
Specifying Which Environment I Am In
After I have uploaded my app where do I specify that my app should now use production environment settings and not development? Can that be done dynamically so that I don''t have to reset a value once I upload website? Thanks for your help!
2006 Jan 23
4
ActionRecord: how to update many records in one statement
Hello, I am trying to edit and update all records of table ?intersts? (id, name, description) on one page and has no good idea how to do it right, when updating one record per page it?s ok The question is: what statement instead Interest.update_all(params[:interest]) in controller need to use to successfully update the database table by data passing to controller in parameter ?interest??
2005 Mar 10
5
dispatch.fcgi dieing randomly
Recently my application has refused to start on my production environment. The setup is debian(unstable)/apache2/fastcgi/mysql Rails 0.10 (upgrading to 0.10.1 as we speak) When I first start up apache the machine grinds to a crawl starting up the dispatch.cfi processes. It''s a VPS with 256M of ram, but still (in addition to user time) it''s spending 30% of time in system
2005 Mar 10
11
Default Values
Where in the application would you suggest I set default values that are read for every action and in some cases changed and somecases not. Basically on some pages I am getting the <title> from the DB and if not I want to put a default one up. Any suggestions?
2006 Apr 11
6
Reduce Number of Queries When Using ActiveRecord
I have a controller method called update_all that grabs parameters for about 30 form fields and saves them to the database. My current code looks to see if there is a string in params[] for each form field (two fields for each SelfEvaluationItem) and saves the updated self_evaluation_answer if a string is available. Since this is iterated code, I am almost certain that this generates 30 or so
2006 Mar 24
6
Should counter_cache fields be saved in the database?
As far as I can tell, the counter_cache option on a belongs_to model doesn''t actually save anything in the database. For example, I have the following models: class Parent < ActiveRecord::Base has_many :children, :conditions => "deleted_at IS NULL" end class Child < ActiveRecord::Base belongs_to :parent, :counter_cache => true end With the following
2005 May 12
26
performance update
I have made additional progress with regard to performance. My latest data: configuration 1: r121.latest configuration 2: r121p.latest page c1 real c2 real c1 r/s c2 r/s c1/c2 /empty/index 6.75525 1.71983 148.0 581.5 3.93 /welcome/index 6.89044 1.89244 145.1 528.4 3.64 /rezept/index 4.99573
2005 Dec 31
4
saving a collection
Reading the Agile book, I can''t find a single command to save a collection. The save command seems to operate on only individual objects. Lets say I have a collection that I have received from a find_all command. I want to go through and change some attributes in various objects in the collection. Then I want to resave the whole collection back to the database. I don''t think
2005 Mar 10
8
Login controller additions
I have added roles and roles_users table and updated the model so that my users can have multiple roles. ("Admin" role does always have id = 1). I have added these methods to my application controller. <code> helper_method :is_admin? helper_method :is_user? def is_admin? if @session[''user''] @session[''user''].roles.find(1)
2006 Apr 28
1
acts_as_taggable help
Ahoy, having a bit of difficulty w/ the acts as taggable GEM. I was able to create a tagcloud, but now i want to filter items by tags. in my controller i have def show_tagged_with <-- snip snip --> @items = Item.find_tagged_with( :any => params[:tag_name]) @categories = Category.find_all @tag_name = params[:tag_name] @tagged_items = Item.tags_count(:limit
2007 Oct 12
2
missing attribute: reorder
I am trying to use an integer object as a flag item for displaying a link on a page called reorder that is a column in my PlanProcedures table. I''m getting an error that says The Header is NoMethodError in Manage_plan_procedures#list missing attribute: reorder Here is what my model looks like: >> PlanProcedure.column_names => ["id", "plan_id",
2006 Jun 22
4
Filter on variable
Hi all, I have a question about filtering on a variable. If I have the following code in my controller to select a list of users > @allusers = User.find(:all, > :conditions => [''team_id = ?'', @params["id"], > :order => ''created_at'') Is there an easy way to find out all users who
2006 Apr 16
11
Best way to sort categories w/ pager
Ahoy, I made this pager, " def list @item_pages = Paginator.new self, Item.count, 10, @params[''page''] @items = Item.find :all, :conditions => "category_id = #{params[:condition]}", :limit => @item_pages.items_per_page, :offset => @item_pages.current.offset @categories = Category.find_all
2008 Jul 02
3
update_all not changing updated_at
Hi everyone- Model.update_all works and changes the records, but it''s not changing the updated_at field. Am I doing something wrong or is this by design? Thanks, Dino --~--~---------~--~----~------------~-------~--~----~ 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
2005 Mar 10
6
problems with ActionMailer
I''m having some problems with ActionMailer and I''m hoping that someone can help. I''ve followed the tutorial on "How To Send Emails With Action Mailer" <URL: http://wiki.rubyonrails.com/rails/show/HowToSendEmailsWithActionMailer >, I''ve generated a mailer -- "notifier.rb" -- and I''ve added the following method to the
2006 Jun 01
2
update_all broken in postgres?
Hi has anyone managed to use update_all with rails on postgres? In my setup, it does not work: >> @keyword.update_all(myupdates) NoMethodError: undefined method `update_all'' for #<Keyword:0xb7ac4670> from /home/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:1786:in `method_missing'' from (irb):14 I checked that the base.rb