search for: tomrossi7

Displaying 20 results from an estimated 26 matches for "tomrossi7".

2011 May 17
8
Changing Rails Default Date Parse Option
Does anyone know how to change the default option for the Date.parse (which ActiveRecord is using on all date fields). I would like the "comp" option to default to true so I don''t have to account for 2- digit dates throughout my application. http://corelib.rubyonrails.org/classes/Date.html#M001228 Thanks! Tom -- You received this message because you are subscribed to the
2009 Aug 06
18
Best Practices Question
Should models call action mailers, or should those calls always originate from controllers? For example, should user.forgot_password send the email, or should the user_controller.forgot_password? Just looking for some opinions... Thanks, Tom
2008 Jan 21
4
Caching CSS Issue
I have a problem I was hoping someone could shed some light on. I noticed that with every request to my server, the css file was being requested. I went ahead and made a static link to the css file so there is no query string at all, but still I see the requests coming in with each request. Do I need to do anything else (in the response header maybe?) to make sure that browsers will cache the
2010 May 15
3
ActiveResource Mock Objects
Some of my tests use ActiveResource HttpMock requests and some of them do not. Does anyone know if there is a way to disable the HttpMocks after they have already been loaded? The method ActiveResource::HttpMock.reset! only removes all the objects, but ActiveResource still thinks it should look for mock requests rather than actually making requests. I hope this makes sense! Thanks, Tom --
2009 May 20
2
Rails 2.3.2 Multipart Emails
I''m trying to send implicit multipart emails with Rails 2.3.2. I have the files as in the past: mailer_action.text.plain.erb mailer_action.text.html.erb When I run my tests, everything looks good. When I deliver email from the console running in production mode, everything looks good. When my controller calls the method, it uses the html template to send a plain text email. Anyone
2009 Jun 24
3
ActiveResource:: HttpMock
I''m trying to set up testing on my ActiveResource project. The HttpMock appears to be what I want, but whenever I use the code in the "documentation", I get the error NameError: uninitialized constant ActiveResource::HttpMock Is there something I need to do to enable HttpMock testing? Thanks, Tom
2007 May 16
2
RMagick Setting Quality or Compression
I am trying to dynamically set the compression or quality of an image when displaying it. I have seen in the RMagick documentation how to set the quality only when writing the file to disk. How can I set the quality dynamically or set the compression? The method "image.quality=" does not exist and "image.compression_type=" is not in the documentation. I have tried
2007 Nov 16
3
Route Information
Is there a method to return a hash of the route configuration based on a path? For example: magic_method(''/my_controller/my_action/my_id'') => {:controller => ''my_controller'', :action => ''my_action'', :id => ''my_id''} Thanks! Tom --~--~---------~--~----~------------~-------~--~----~ You received this message
2010 Feb 11
2
Inconsistent Hash#to_xml Method
I have a unit test that demonstrates some inconsistent behavior with a Hash being converted to XML with the :root option. Sometimes it works fine: Hash.new.to_xml(:root => ''test'') "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test>\n</test>\n" But sometimes I get an argument error: Hash.new.to_xml(:root =>
2008 Oct 09
2
has_many validation the Rails way
Okay, this is something I run into a lot and don''t really have a great solution. Here is a simple example: class Blog < ActiveRecord::Base has_many :posts validates_presence_of :name end class Post < ActiveRecord::Base belongs_to :blog validates_presence_of :name validates_presence_of :blog_id end Now, if I want to create a blog and post at the same time I
2009 May 28
7
shorten a link
Suppose a user submits a url: http://www.nyt.com/education/2345545. How can this be shortened to a cleaner url, like nyt.com? -- Posted via http://www.ruby-forum.com/.
2007 Aug 17
3
Problem Installing RMagick
Okay, so I am setting up a brand new Macbook and can''t seem to get RMagick or ImageMagick to install with Darwin Ports. Can anyone give me some insight as to why this may be failing? I get the same error when I do a "sudo port install imagemagick". Thanks! sudo port install rb-rmagick Password: ---> Building XFree86 with target World Error: Target org.macports.build
2009 Oct 12
1
ODBC with Snow Leopard
Can someone please post or refer to detailed instructions for getting Rails going on Snow Leopard with ODBC to a MS SQL server? The Rails Wiki is pretty bad and I can''t seem to get it going! Thanks, Tom
2010 Feb 09
1
Eager Loading
Is there a way to specify within a model that an association should always be loaded. For example, the classic example from the API docs: Post.find(:all, :include => :author) What if I ALWAYS wanted the author to be loaded whenever a Post object was created? So, in essence, Post.find(:all) would bring back each post with the associated author object already loaded. Thanks! -- You
2010 Feb 23
2
Logging and Exceptions with Script Runner
I have cron jobs that run script/runner commands and I have two questions: 1. Should logging be working when calling the logger methods from an object within the script? 2. Should Exception Notification work when an exception occurs in the script/runner? Thanks! Tom -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to
2010 Dec 11
1
ajax :update option with Rails 3
With Rails 2.3.9, I could use the :update option with an ajax helper if I just wanted to update the contents of an element. The controller action looked liked this: format.js { render :parital => ''_updated_object'', :layout => false } I''m trying to figure out how to accomplish the same thing with Rails 3 ujs? I know I can accomplish this by having the controller
2010 Dec 20
1
Writing to a CSV with Faster::CSV
Is there a way to write a csv file using a hash instead of an array? Something like this: header_keys = :first_name, :last_name, :email FasterCSV.open("path/to/file.csv", "w") do |csv| User.all.do |user| csv << user end end Thanks... -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2007 Oct 05
1
RESTful Thinking
Okay, so I am trying to embrace the RESTful approach to web application design and wanted to get some feedback from others. I understand that it can be done different ways, I''m just interested to see what real RESTful theorists think. Lets say that you have an application that has lists and items on that list. I can see how both lists and items can be set up as resources. Now, lets
2010 Dec 23
36
Weird issue with converting floats to integer
Any idea why this calculates the integer the way it does? irb> ("291.15".to_f * 100.0).to_i => 29114 Thanks, Tom -- 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
2007 May 01
0
Image Science vs. RMagick
I''m looking at possibly going with Image Science (http:// seattlerb.rubyforge.org/ImageScience.html) for an application in development. I''ve heard that it is a lot less overhead than RMagick and we really don''t have any complex image requirements. Are there any folks out there using Image Science that could chime in with some feedback? Also, I have a couple specific