[Rails] Re: mysql2 and swedish characters

2011-09-14 Thread michael_teter
Bummer, this didn't work for me. I think I'm having a similar problem. I was using mysql gem, database was utf8, but I was getting an occasional template encoding error. That prompted me to update my driver to mysql2 (which solved my template problem), but resulted in formerly correct

[Rails] Re: mysql2 and swedish characters

2011-09-14 Thread michael_teter
More info... In rails console, mysql driver shows this for the column value: Bj\xF6rn mysql2 driver shows this for the column value: Björn F6 hex is the UTF8 code for o umlaut, so the mysql(1) view seems more correct than the mysql2 view of the column value... -- You received this message

[Rails] Re: mysql2 and swedish characters

2011-09-14 Thread michael_teter
Ahh, I'll make a few more blob/text round trips and see if that helps. Yeah, the F6 thing was created by mysql(1) driver. Now mysql2 apparently doesn't understand. Thanks! -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this

Re: [Rails] Route help?

2011-05-14 Thread michael_teter
I knew there was a route way to do this, and I found the simple way. The last route in my routes.rb is now this: match *username, :to =site#index And in my site controller's index handler, I User.find_by_username(params[:username]) to know which user's site I'm now a guest of. -- You

[Rails] Route help?

2011-05-09 Thread michael_teter
Howdy. I'm trying to figure out how to do the route equivalent to URL- rewriting such that http://example.com/some_username is treated like a REST get on example.com/users/username (rather than id number). Suggestions? Thanks much. -- You received this message because you are subscribed to

[Rails] Re: Authentication recommendations?

2011-05-03 Thread michael_teter
Thanks to all for the great information! -- 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@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Authentication recommendations?

2011-05-02 Thread michael_teter
Howdy. I'd like to solicit recommendations for authentication systems for Rails apps. I rolled my own basic system the last project I had, but I'd like to leverage others' good work this time. However, I don't have much time to investigate the current offerings. Most important to me is

[Rails] Need activerecord-oracle-adapter-1.0.0.9216 gem for legacy reasons

2010-11-09 Thread michael_teter
I'm trying to duplicate a production environment that uses activerecord-oracle-adapter-1.0.0.9216, but as far as I can tell all traces of that gem have vanished from repositories online. Does anyone know where I can get the following gem? activerecord-oracle-adapter --version=1.0.0.9216 Thanks

[Rails] Re: Maintain connections to two databases

2010-09-23 Thread michael_teter
, 3:11 pm, Michael Schuerig mich...@schuerig.de wrote: On Wednesday 22 September 2010, michael_teter wrote: I tested this in production mode, and it's _much_ faster.  It's fast enough that I'm almost certain that it's not reconnecting to the secondary database each time (at least

[Rails] Re: Maintain connections to two databases

2010-09-22 Thread michael_teter
differently (with respect to connections/pools/ reconnects); and I don't have time to investigate deeper. But thanks for the suggestions and analyses! On Sep 21, 6:04 am, Michael Schuerig mich...@schuerig.de wrote: On Tuesday 21 September 2010, michael_teter wrote: Yes, I'm making the connection

[Rails] Re: Maintain connections to two databases

2010-09-21 Thread michael_teter
Michael, Yes, I'm making the connection in my model as you describe. That is working fine in the sense that it is connecting to the secondary database. My problem is, it appears to be connecting every time I instantiate that object. I've traced the entire establish_connection path, and it

[Rails] Maintain connections to two databases

2010-09-20 Thread michael_teter
Howdy. My app is required to perform some user-driven CRUD operations on two databases simultaneously. This is not the normal situation, but it applies to a low-activity admin controller. My current solution involves three models - DbDual, DbPrimary, and DbSecondary. DbDual uses the other two

[Rails] Re: Maintain connections to two databases

2010-09-20 Thread michael_teter
I'm actually not using Passenger. I use a cluster of 50 mogrels behind an Apache2. Since my app started pre Rails 2.0 (and is only now up to 2.3.8), I'm not using connection pooling (as far as I know :) ). My understanding is that each mongrel instance is maintaining its own db connection. I

[Rails] Re: I want to build a Web App with Rails.... What to use for the Client Layer?

2010-09-20 Thread michael_teter
I suppose you're not allowed to use Flash/Flex? For non-Flash, moderately rich UI, I'm pretty happy with some of the YUI (Yahoo User Interface) widgets and libraries. You might also consider GWT. If you know that you're building a big fat (rich) client, it might be worth having a comprehensive

[Rails] San Francisco Rails Pay Rates?

2010-06-21 Thread michael_teter
Howdy. I'm curious if anyone has a sense of what the typical Rails contract (W2) rates are for Rails developers in the San Francisco area. Assume the typical requirements of 2-3 years Rails experience, with 5+ years general development experience. From my experience in the Texas market, the

[Rails] Re: Controllers, what? why?

2010-06-21 Thread michael_teter
My simple explanation is it's a matter of organization. We create controllers to organize our code and to add a little bit of context for the users who actually look at URLs. If you have a very simple app, one controller may suffice. But once your app starts providing a number of features, it

[Rails] seeking optimization help - overridden to_xml()

2009-07-09 Thread michael_teter
Howdy. I've got an overridden to_xml() function in one of my models that appears to be very slow. As a relative Ruby novice, I would love to hear suggestions on how to improve the performance. Incidentally, I was using the default to_xml() provided by ActiveRecord, but it wasn't handling null

[Rails] Canceled/abandoned request to Mongrel/Ruby

2009-03-05 Thread michael_teter
Howdy. I'm wondering what happens in Mongrel/Ruby when a user asks for a page but then hits Stop in the browser or just clicks a different link before the response comes back. The reason I ask is that the app I'm building does a fair amount of database work on each page. From what I can tell,

[Rails] Oracle date problems, and how to make alter session work

2009-01-09 Thread michael_teter
Howdy. Something change recently (Oracle upgrade and/or new gem) that's causing ActiveRecord to give me very unfriendly dates from Oracle. I believe the old dates I was getting were -MM-DD. The ones I'm getting now are like this: Tue Dec 23 00:00:00 -0600 2008 Oddly enough, telling my

[Rails] Re: Oracle date problems, and how to make alter session work

2009-01-09 Thread michael_teter
Ok, I've done this, and it works for me mostly... Now I have to figure out why to_xml() is changing the date format to the big ugly version . For example: errs = Errors.find(:all, :conditions = errtype = 2) = [#Errors blah blah blah, crtd: 2009-01-07 00:00:00 ...] errs.to_xml(:dasherize =

[Rails] Re: Oracle date problems, and how to make alter session work

2009-01-09 Thread michael_teter
Yeah, the specific post is http://www.ruby-forum.com/topic/57923#548266 Unfortunately that's not working for me. I assume I should just be able to do: Hash::XML_FORMATTING['datetime'] = Proc.new { |datetime| datetime.to_s(:rfc822) } errs.to_xml I'm still getting the long date in the XML

[Rails] Re: Oracle date problems, and how to make alter session work

2009-01-09 Thread michael_teter
in previous message, and I've also tried just modifying conversions.rb as a test. Neither change had any effect on to_xml(). to_xml() insists on making my dates look like Tue Dec 23 00:00:00 -0600 2008 Any clues now? On Jan 9, 3:07 am, michael_teter michael.te...@gmail.com wrote: Yeah, the specific

[Rails] Re: Oracle date problems, and how to make alter session work

2009-01-09 Thread michael_teter
So if I do this: class Errors ActiveRecord::Base def crtd_x crtd.strftime(%Y-%m-%d) end ... end errs = Errors.find(:all, :conditions = ...) errs.to_xml(:methods = [:crtd_x, ...]) It fails with a NoMethodError: You have a nil object when you didn't expect it! The error

[Rails] Confused about to_xml() in ActiveRecord::Base subclass

2009-01-09 Thread michael_teter
Since all my efforts to control how to_xml() is formatting dates has failed, I'm now considering writing my own to_xml(). However, from the limited examples I've found, I just don't understand how to actually reference the columns for the records in my record set. Here's a simplified view of my

[Rails] Re: Confused about to_xml() in ActiveRecord::Base subclass

2009-01-09 Thread michael_teter
, michael_teter wrote: Since all my efforts to control how to_xml() is formatting dates has failed, I'm now considering writing my own to_xml().  However, from the limited examples I've found, I just don't understand how to actually reference the columns for the records in my record set. Here's

[Rails] ActiveRecord.find results as array of arrays

2008-12-17 Thread michael_teter
Howdy. I imagine this is an elementary Ruby question, but I'd love to learn the right Ruby idiom for this. I'd like to take the results of an ActiveRecord.find() and turn them into an array of arrays [[item1_col1,item1_col2], [item2_col1, item2_col2]]. Here's my code sample of the brute force

[Rails] Re: ActiveRecord.find results as array of arrays

2008-12-17 Thread michael_teter
using strings though. Thanks! On Dec 17, 2:39 am, Franz Strebel franz.stre...@gmail.com wrote: On Wed, Dec 17, 2008 at 9:08 AM, michael_teter michael.te...@gmail.com wrote: Howdy.  I imagine this is an elementary Ruby question, but I'd love to learn the right Ruby idiom for this. I'd

[Rails] unterminated string literal, how to properly send strings

2008-12-09 Thread michael_teter
I have a line like the following in my Rails view/template (generating JavaScript): script type=text/javascript ... y = escape('%= h(e.error_desc) %'); ... /script Because some of the error_descs have newlines, the browser is receiving page code that looks like this: y = escape('Information

[Rails] Re: unterminated string literal, how to properly send strings

2008-12-09 Thread michael_teter
I believe I found the solution I was looking for - escape_javascript (). Seems obvious now, but somehow I hadn't encountered it (and amazingly, none of my searches for rails javascript unterminated literal string turned up this useful function. It's part of the Rails JavaScript helpers.

[Rails] Long running query causes Mongrel/Rails to block completely?

2008-10-29 Thread michael_teter
Hi. I'm troubleshooting a problem, and I would love some help understanding what is going on. The problem is that Mongrel/Rails appears to hang or completely block if one of the users initiates a very slow, long-running query (via an ad-hoc report generation tool from within the app). For

[Rails] Re: Long running query causes Mongrel/Rails to block completely?

2008-10-29 Thread michael_teter
I don't know how practical this is, but I can envision a system whereby each process wraps a request/response with a Start End message to a load balancer so it will know which processes are busy and which are not. Further, the load balancer could keep statistics that might be useful in

[Rails] Re: Long running query causes Mongrel/Rails to block completely?

2008-10-29 Thread michael_teter
. - Maurício Linhareshttp://alinhavado.wordpress.com/(pt-br) |http://blog.codevader.com/(en) João Pessoa, PB, +55 83 8867-7208 On Wed, Oct 29, 2008 at 12:26 PM, michael_teter [EMAIL PROTECTED] wrote: I don't know how practical this is, but I can envision a system whereby each process wraps

[Rails] AJAX help - proper use of remote_function

2008-09-24 Thread michael_teter
Hi. I'm having a hard time understanding how to use remote_function(). Here's what I want to do: I have two divs. The one on the left lists criteria names. When the user clicks on one of the entries in the listbox on the left, I want to make a remote call to the server to populate the right