[Rails] Re: Rails problem

2009-07-13 Thread Fresh Mix
Bump -- 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@googlegroups.com To unsubscribe from

[Rails] Re: .html/.html.erb/.rhtml to PDF

2009-07-13 Thread Sandip Ransing
Thanks ! Sandip R~ --~--~-~--~~~---~--~~ 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 ru

[Rails] Re: Can we call php function in Rails ?

2009-07-13 Thread Marnen Laibow-Koser
Srinivas Iyer wrote: > Thanks Marnen for your Suggestions > > Out of the two solutions you have suggested , which one will provide > better performance , I have no idea. > > If i create the PHP app as an external Web Service and and call the > method , My application should always

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Marnen Laibow-Koser
Hassan Schroeder wrote: > On Mon, Jul 13, 2009 at 9:00 PM, Marnen > Laibow-Koser wrote: > >> I do understand that it might be useful to do >> >> @hassan.set_alarm_clock(AbstractTime.new(:hour => 7, :minute => 0)) > > It might, but it isn't to me, and it *isn't the use case I described*. > > "Wh

[Rails] Re: Can we call php function in Rails ?

2009-07-13 Thread Srinivas Iyer
Thanks Marnen for your Suggestions Out of the two solutions you have suggested , which one will provide better performance , If i create the PHP app as an external Web Service and and call the method , My application should always be dependent on the Apache Server and this may afftec

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Hassan Schroeder
On Mon, Jul 13, 2009 at 9:00 PM, Marnen Laibow-Koser wrote: > I do understand that it might be useful to do > > @hassan.set_alarm_clock(AbstractTime.new(:hour => 7, :minute => 0)) It might, but it isn't to me, and it *isn't the use case I described*. "What time do you typically get up?" How sim

[Rails] Re: Locking, and How to Test it

2009-07-13 Thread Marnen Laibow-Koser
Brian wrote: > This is a two part question. Which type of locking should I use > (optimistic vs. pessimistic) and then how do I account for locking in > my tests? > > My scenario is essentially the purchase of a unique item where the > first person to click "Buy" gets the item [...] I doubt tha

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Marnen Laibow-Koser
Hassan Schroeder wrote: [...] > Gah. I give up. That's like saying you can't discuss the abstract idea > of "pancakes" without specifying the meal they will be (or were) eaten > at. Not quite. I can discuss the abstract idea of pancakes without mentioning ingredients, but if I want to make some

[Rails] Re: How to add default value to text_field_with_auto_complete

2009-07-13 Thread Thriving K.
It works know , thank you i come up with this = text_field_with_auto_complete :projecttag, :name,{:value =>"555"},{:skip_style => true} -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

[Rails] Re: Locking, and How to Test it

2009-07-13 Thread Brian
This technique works well. I'm able to reimplement save (or save!) to simulate pretty much any race condition I want to handle. I ended up with something like this: # mock save to simulate another user getting there first. sneaky_user = users(:brian) ItemForSale.send(:define_method, :save

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Hassan Schroeder
On Mon, Jul 13, 2009 at 8:28 PM, Marnen Laibow-Koser wrote: > A clock time cannot be a useful without a time zone -- even if that time > zone is set to a sensible default, it's still *there*. Gah. I give up. That's like saying you can't discuss the abstract idea of "pancakes" without specifying

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Marnen Laibow-Koser
Hassan Schroeder wrote: [...] > And that's 100% silly. If I say that I typically get up at 7:00, it's > totally > irrelevant where I am. I get up at 7 in San Jose. I get up at 7 in New > York. I get up at 7 in Frankfurt. I get up at 7 in Ubud. It's 7 hours > after > midnight wherever I happen to

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Hassan Schroeder
On Mon, Jul 13, 2009 at 6:24 PM, Marnen Laibow-Koser wrote: >> "what time will you get up tomorrow" and "what time do you typically >> get up" seem pretty obviously different to me... :-) > > True.  But even here, there's a time zone.  If I get up at 7:30 Pacific > Time tomorrow instead of 7:30 E

[Rails] Excessive use of CPU

2009-07-13 Thread Leandro Maioral
Hello guys and girls, I have a problem with a method (new), it is using 100% of CPU for 15/20 seconds. Follow the method below: http://pastie.org/537568 ## kits_controller.rb def new @page_title = 'Add a Kit' @kit = Kit.new @num_itens = 16 @kit_inclusions = Array.new @num_itens.times { @

[Rails] Re: first app on Dreamhost with Passenger : authenticate problem, session redirecting

2009-07-13 Thread John Yerhot
Hmm.. check the obvious stuff - that the user account exists and you have the correct username and password - if you do and everything database wise looks ok, can you post a bit of the log? On Jul 13, 4:06 pm, Brian wrote: > No, I think my app is there.  Now it looks like there's a problem with

[Rails] Re: Protecting code and licensing for independently deployed Rails applications...?

2009-07-13 Thread Marnen Laibow-Koser
Michael Williams wrote: [...] > My concern(s) then revolve(s) around protecting code and update models > (registration codes, etc.) for multiple independently deployed Rails > applications. There was a thread on this topic not long ago. Probably the best way to protect source code is to use J

[Rails] Protecting code and licensing for independently deployed Rails applications...?

2009-07-13 Thread gberz3
Hi All, I'm writing a Rails application which will have reasonably regular updates -- nothing abnormal here. I face a problem, however, due to the distribution model. Basically the application will be sold for stand-alone "intranet" installation due to its "add-on" nature (it's basically a web

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Marnen Laibow-Koser
Hassan Schroeder wrote: [...] > "what time will you get up tomorrow" and "what time do you typically > get up" seem pretty obviously different to me... :-) True. But even here, there's a time zone. If I get up at 7:30 Pacific Time tomorrow instead of 7:30 Eastern Time, I will miss my appointme

[Rails] Re: test problem

2009-07-13 Thread gaoxh gaoxh04
I have fixed this problem. This is related to the issue that I tried to name some classes with reserved name "test". Thanks all!! 2009/7/13 gaoxh gaoxh04 > sorry, i didn't get it.. how can i fix this problem? > > 2009/7/13 Gavin > > >> Xiahong, >> >> The message "Test is not a module" is the er

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Hassan Schroeder
On Mon, Jul 13, 2009 at 4:47 PM, Marnen Laibow-Koser wrote: >> What time do you normally wake up?  7:00 would be one answer :-) >> No date or TZ associated with that... > > I don't really think I agree. When I go to sleep tonight, I will get up > at 7:30 a.m. Eastern Time (not Pacific or Central

[Rails] Re: Use of self in a class

2009-07-13 Thread Marnen Laibow-Koser
Buzz Hill wrote: > To Everyone, > > Thanks for your help. > > When you are confused about something, it is sometimes hard to distill > all your thoughts down to the essence of the issue and ask the right > question. But I am trying to define a CONSTANT using the result of an > instance method

[Rails] Re: test problem

2009-07-13 Thread gaoxh gaoxh04
sorry, i didn't get it.. how can i fix this problem? 2009/7/13 Gavin > > Xiahong, > > The message "Test is not a module" is the error you want to address. > > I'd check that your test helper doesn't have "include Test" or maybe > Test.module_eval someplace in it. > > :S > > > > On Jul 13, 3:15 p

[Rails] Re: New to Rails? Read This

2009-07-13 Thread Dave Porter
To add another book to the three initially mentioned ( which are all very good ! ) Ruby on Rails Bible ( released late last year ! ) http://www.amazon.com/Ruby-Rails-Bible-Timothy-Fisher/dp/0470258225 http://www.rubyonrailsbible.com/ cheers, Dave Porter On Jul 14, 4:44 am, "Älphä Blüë" wrote:

[Rails] Re: Use of self in a class

2009-07-13 Thread Buzz Hill
To Everyone, Thanks for your help. When you are confused about something, it is sometimes hard to distill all your thoughts down to the essence of the issue and ask the right question. But I am trying to define a CONSTANT using the result of an instance method and Ruby just doesn't allow that

[Rails] Re: Associations - Better solution?

2009-07-13 Thread pepe
Thanks to all for your replies. All very good. As I mentioned in my reply to Fred, I ended up using STI for this. Without knowing it is pretty much what I was doing manually. The built in functionality allows me to not have to do the final 'find' by hand and retrieves the record through the corre

[Rails] Re: Replicating link_to_remote in raw js

2009-07-13 Thread Conrad Taylor
On Mon, Jul 13, 2009 at 10:31 AM, JannaB wrote: > > This is an interesting problem: > > I have a view that has a div that gets replaced by innerhtml using a > settimer() in js. > > The settimer() invokes a js function (makemytable())that creates a > table in html based on json data that gets writ

[Rails] [ANN] External Search Sources Rails Engine

2009-07-13 Thread Kieran P
Announcing the release of the External Search Sources Rails Engine developed by Katipo Communications (http://katipo.co.nz) for Kete (http://kete.net.nz), and funded by Digital New Zealand (http:// digitalnz.org.nz) and Katipo. http://github.com/kete/external_search_sources What

[Rails] Re: Associations - Better solution?

2009-07-13 Thread pepe
Hi Fred, Just [re]discovered about STI right after my answer to the first reply. I made the necessary changes to the users table, tried it and it worked quite fine when I fixed the kinks trying to access the value with user.type. Once I figured that one out everything worked as expected. Thanks.

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Marnen Laibow-Koser
Hassan Schroeder wrote: > On Mon, Jul 13, 2009 at 2:38 PM, Matt Jones wrote: > >> I'm somewhat curious what makes sense for a dateless, zoneless time. > > What time do you normally wake up? 7:00 would be one answer :-) > No date or TZ associated with that... I don't really think I agree. When

[Rails] Re: Flash message not being displayed

2009-07-13 Thread Chad Arimura
Not sure if you got this answered but a guess would be because the flash hash is persisted only across the same domain... your subdomain doesn't see the flash message. On Jun 22, 12:39 pm, Oliver Nightingale wrote: > Yeah, I should have mentioned that sorry. > > I can display flash messages,

[Rails] Re: Deployment on Dreamhost - Application Error

2009-07-13 Thread Marnen Laibow-Koser
Pepe Junty wrote: [...] > fulltext search. each database or indexing tool requires a different > implementation. Sure, but isn't there an abstraction layer just like with basic SQL in ActiveRecord? Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.r

[Rails] Re: What's your favorite IDE or Editor for Rails?

2009-07-13 Thread Marnen Laibow-Koser
Älphä Blüë wrote: > Hi all, > > I'm trying to put together a comprehensive list of IDEs and Editors for > Rails that people enjoy using. [...] Please, let's not start another thread on this. There's lots of info in the list archives if one bothers to search. Best, -- Marnen Laibow-Koser http:

[Rails] Re: Can we call php function in Rails ?

2009-07-13 Thread Marnen Laibow-Koser
Srinivas Iyer wrote: > Hi all , > > I have a small doubt , Can we call a php function in Rails . Is there > any > Interpreter or a Bridge in which Rails application can talk to a Php > File Not as such. I'd suggest either of the following two options: * Treat your PHP app as an external

[Rails] Looking for a rack middleware to dump http request response traces

2009-07-13 Thread Rick DeNatale
I was thinking about writing a rack middleware which would dump each request and response coming into a server, but I thought that surely something like that must surely already exist. I'd like to write somthing like this: http://bit.ly/lot3d to a log file. My googling skills are failing me in

[Rails] Re: Associations - Better solution?

2009-07-13 Thread Älphä Blüë
Ashrafuz Zaman wrote: > Have you tried, > > class Audit < ActiveRecord::Base > belongs_to :auditor, :class_name => 'User', :foreign_key => > 'auditor_id' > belongs_to :tenant, :class_name => 'User', :foreign_key => > 'tenant_id' > end > > class User < ActiveRecord::Base > has_many :audito

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Hassan Schroeder
On Mon, Jul 13, 2009 at 2:38 PM, Matt Jones wrote: > I'm somewhat curious what makes sense for a dateless, zoneless time. What time do you normally wake up? 7:00 would be one answer :-) No date or TZ associated with that... -- Hassan Schroeder hassan.schroe...@gmail.c

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Matt Jones
You may be interested in the _before_type_cast accessor - that will let you read whatever the DB is actually returning. I'm somewhat curious what makes sense for a dateless, zoneless time. Either the app that consumes the data is *assuming* the missing info (hard to do, as even time comparisons g

[Rails] Re: Associations - Better solution?

2009-07-13 Thread Matt Jones
Yes - check out the Rails docs for discussion of Single-Table Inheritance. The major change will be that your 'category' column will be renamed to 'type', and you'll be able to skip the second find step. --Matt Jones On Jul 12, 10:43 am, pepe wrote: > Hi all, > > I found what I think is a slick

[Rails] Re: named_scope and its :order function.

2009-07-13 Thread Matt Jones
Try this: named_scope :by_user_value, :include => :user, :order => 'users.value' If you're not accessing the user association, you could also use :joins instead of :include, but I'm guessing you'll need to load those records anyways. --Matt Jones On Jul 12, 11:01 pm, 刘子嘉 wrote: > Could someon

[Rails] Re: first app on Dreamhost with Passenger : authenticate problem, session redirecting

2009-07-13 Thread Brian
No, I think my app is there. Now it looks like there's a problem with restful_authentication. I get my logon page and when I login, it redirects me back to the login page. When I look at the log, it looks like it's working; it's going through the SessionsController#create, getting a Session ID,

[Rails] Re: What's your favorite IDE or Editor for Rails?

2009-07-13 Thread Älphä Blüë
As an extra add, Netbeans more formerly is used with jRuby development. However, I do not use jRuby so therefore I cannot comment on that piece within Netbeans. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because

[Rails] What's your favorite IDE or Editor for Rails?

2009-07-13 Thread Älphä Blüë
Hi all, I'm trying to put together a comprehensive list of IDEs and Editors for Rails that people enjoy using. I want to append this list to the "New to Rails" topic I've been expanding upon. If you could take the time to list out your current IDE and editor and a brief summary of why you enjoy

[Rails] Re: New to Rails? Read This

2009-07-13 Thread Älphä Blüë
> Found anything good on Rails + Ajax yet? I > can't decide whether to order Scott Raymond's book or not since the > abstract seems to indicate I can learn the same things reading > script.aculo.us reference material. Well, I'm really glad you asked this particular question. I'm still going th

[Rails] Re: Starting up with Ruby on Rails..

2009-07-13 Thread Colin Law
2009/7/13 Renzo : > > Hi guys.. I want to learn Ruby on Rails.. Actually I already have a > Computer Based Training CD in Ruby on Rails by Lynda.com.. But I'm > having a hard time in deploying the requirement 'coz in the training > video the speaker is working on Mac OS.. But I'm using Windows.. H

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Colin Law
2009/7/13 Josh : > > Thanks for all the points and it is useful to think about the rails > time not having time_of_day. I still am not sure my problem was clear. > It seems to me that there should at least be a :emulate_datetime => > false sort of option like with booleans, ex. > > ActiveRecord::C

[Rails] Re: DRY way of updating flash in AJAX

2009-07-13 Thread jhaagmans
I have a thought ... I could add a general respond_to to the end of my controller which responds to every AJAX-request. However, I'm unsure how to do this. I've tried a few things, but none of them seem to work the way I want them to. If this would work I would be able to evaluate flash[:warning

[Rails] Framework/templating language performance: Ruby vs. Rack vs. Sinatra and ERB vs. Builder vs. HAML

2009-07-13 Thread Rob Cameron
For those interested in the nitty gritty of performance, I just posted part 1 of my Ultimate Ruby Performance test: Ruby vs. Rack vs. Sinatra each running ERB, Builder, HAML and plain HTML. http://www.ridingtheclutch.com/2009/07/13/the-ultimate-ruby-performance-test-part-1.html --~--~-~-

[Rails] Starting up with Ruby on Rails..

2009-07-13 Thread Renzo
Hi guys.. I want to learn Ruby on Rails.. Actually I already have a Computer Based Training CD in Ruby on Rails by Lynda.com.. But I'm having a hard time in deploying the requirement 'coz in the training video the speaker is working on Mac OS.. But I'm using Windows.. He said that there's a one cl

[Rails] Can we call php function in Rails ?

2009-07-13 Thread Srinivas Iyer
Hi all , I have a small doubt , Can we call a php function in Rails . Is there any Interpreter or a Bridge in which Rails application can talk to a Php File and call a specific method from php file . Thanks in Advance --~--~-~--~~~---~--~~ You received this m

[Rails] Re: errors.add don't work

2009-07-13 Thread Herman Müller
I found a solution. My fault was, that there where two validations with the same name --> "def validate". In found in the rails api the solution: I have only to rename the validation blocks an then trigger the validations with " validate :block_name" Here are my new tbl_banks.rb entries: v

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Josh
Thanks for all the points and it is useful to think about the rails time not having time_of_day. I still am not sure my problem was clear. It seems to me that there should at least be a :emulate_datetime => false sort of option like with booleans, ex. ActiveRecord::ConnectionAdapters::MysqlAdapte

[Rails] Re: New to Rails? Read This

2009-07-13 Thread John Yerhot
Don't forget the official Rails Wiki - http://wiki.rubyonrails.org. Lots of good info there. On Jul 13, 2:09 pm, Brian wrote: > So yes, it's important to write your topic with something specific and > interesting so that the experts want to read and help.  But with some > luck, you'll still get

[Rails] Re: first app on Dreamhost with Passenger : "rails needs to know your username and password" ?

2009-07-13 Thread John Yerhot
No problem. It sounds to me like there is a bare Rails app there, not your app. Good luck - post back if you need more help :) On Jul 13, 12:28 pm, Brian wrote: > Nope, it's still there.  Now I really feel like a dork.  Also, my > regular 'starting point' I had been using was a different page,

[Rails] Re: New to Rails? Read This

2009-07-13 Thread Brian
So yes, it's important to write your topic with something specific and interesting so that the experts want to read and help. But with some luck, you'll still get views with a poorly written topic. There's a better (in my opinion) reason to be specific -- to help the people who have the same iss

[Rails] Re: Help with loading data with sequential id

2009-07-13 Thread khagimoto
Thanks for the pointer! I modified the codes.yml file to look like this (below) and now it inserts ordered list with sequential ids. I had to try it several times to get the spacing right.. I had two spaces (no tabs) in front of the key:value pair initially, but it needed four spaces instead. =

[Rails] Re: DRY way of updating flash in AJAX

2009-07-13 Thread jhaagmans
I still haven't found how to do this. The only thing I could think about was adding a .rjs file for the controller to /app/layouts, but that doesn't work. Anyone? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: .html/.html.erb/.rhtml to PDF

2009-07-13 Thread Jeff Lewis
I'd also recommend princexml if you can afford it. And I'm a big f/ oss proponent. Been using it on a couple of apps for clients in the past couple of years and have been very happy with results. The coverage of (standard) print-related css is very good. I can't tell you how much time has been

[Rails] Re: Controller calling .. ?

2009-07-13 Thread Hemant Bhargava
Thanks Champs .. Got it .. :) Colin Law wrote: > 2009/7/13 Hemant Bhargava : >> >> How can i call a function/method defined in a controller into another >> view .. ? > > > Possibly put the method in the model instead. > > Colin -- Posted via http://www.ruby-forum.com/. --~--~-~--~--

[Rails] Replicating link_to_remote in raw js

2009-07-13 Thread JannaB
This is an interesting problem: I have a view that has a div that gets replaced by innerhtml using a settimer() in js. The settimer() invokes a js function (makemytable())that creates a table in html based on json data that gets written on the server every 2 seconds. So, every 2 seconds, the ta

[Rails] Re: first app on Dreamhost with Passenger : "rails needs to know your username and password" ?

2009-07-13 Thread Brian
Nope, it's still there. Now I really feel like a dork. Also, my regular 'starting point' I had been using was a different page, and it is loading. However, now it looks like my data isn't there. I'm loading a couple of lookup tables in the migrations (I know now that is discouraged, but I'm st

[Rails] Re: accessing model attribute name dynamically

2009-07-13 Thread Jeff Lewis
Maybe I'm not understanding what you're sending as a val for @field, because if it's a string of the model attribute name, it should work: $ script/console >> klass = Klass.find(:first) => # >> klass.foo => "bar" >> klass["foo"] => "bar" >> klass["foo"] = "biz" => "biz" >> klass["foo"] => "b

[Rails] Re: Deployment on Dreamhost - Application Error

2009-07-13 Thread Pepe Junty
Marnen Laibow-Koser wrote: > Like what? I confess that I'm extremely hard-put to think of a mySQL > feature that PostgreSQL doesn't have. (Syntax is sometimes different, > but you probably shouldn't be writing literal SQL in a non-portable way > in Rails.) fulltext search. each database or i

[Rails] Re: accessing model attribute name dynamically

2009-07-13 Thread Dan Berger
Jeff Burlysystems wrote: > Another alternative: > > ... > @meta[field] = content > ... > > Jeff > > On Jul 13, 9:32�am, Dan Berger I tried that one, and it didn't work ... error message said Ruby couldn't translate {field} into an integer, even though I wanted a string But thanks.

[Rails] Re: accessing model attribute name dynamically

2009-07-13 Thread Jeff Lewis
Another alternative: ... @meta[field] = content ... Jeff On Jul 13, 9:32 am, Dan Berger wrote: > Jamey Cribbs wrote: > > How about: > > > @meta.send("#{field}=", content) > > > Jamey > > > On Fri, Jul 10, 2009 at 4:31 PM, Dan > > That's it. Thanks! > -- > Posted viahttp://www.ruby-forum.

[Rails] Re: accessing model attribute name dynamically

2009-07-13 Thread Dan Berger
Jamey Cribbs wrote: > How about: > > @meta.send("#{field}=", content) > > Jamey > > > On Fri, Jul 10, 2009 at 4:31 PM, Dan That's it. Thanks! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] Re: dynamic paths

2009-07-13 Thread Bob O
After diving into a few mentioned scenarios (thanks Frederick) the polymorphic_path and polymorphic_url is what i was looking for. thanks guys B On Jul 13, 7:40 am, Bob O wrote: > Let me see if i can be more clear, and i will try some of the > suggested solutions > > Im trying to make the rout

[Rails] Re: Ways to chart data in Rails?

2009-07-13 Thread Marnen Laibow-Koser
E. Litwin wrote: [...] > If you have a graphing requirement for the mobile browser version > (which you may not even have - don't know what your application is), > then the Flash requirement will be an issue. I think you missed my point. First of all, I was using mobile browsers only as an exa

[Rails] Re: Help with loading data with sequential id

2009-07-13 Thread Franco Catena
I suppose you want use the omap YAML type. Read about it in http://api.rubyonrails.org/classes/Fixtures.html and in http://yaml.org/type/omap.html. Regards. Franco Catena. On Jul 13, 12:34 pm, khagimoto wrote: > Hello, > > I'm trying to load data into my mysql table using the following: > > ==

[Rails] Passing a DB connection between scripts

2009-07-13 Thread James Byrne
I am attempting to test a stand-alone script. I wish to call the script from inside the test framework, passing it a variety of command line arguments, and verify the results. The difficulty I have is that the testing framework I am using, cucumber, holds db updates inside an incomplete db trans

[Rails] Re: Ways to chart data in Rails?

2009-07-13 Thread Älphä Blüë
I personally use fusion charts but only because my site "requires" flash in order to use the interactive media in my subscription model. So, as Marnen suggested, if you don't require flash on your site, you might not want to use fusion charts. If you do happen to use fusion charts, and your s

[Rails] Re: Database Diagram Advice needed plus Normalization

2009-07-13 Thread Älphä Blüë
I'm thinking along the lines of: libs/ .. calculations.rb = which would run calculations for standard deviation and variation on data provided to it... libs/tasks/ .. calculations.rake desc "Calculate Ratings" task :calculate_all_ratings => :environment do calculate_rushing = RushingOffens

[Rails] Re: Ways to chart data in Rails?

2009-07-13 Thread E. Litwin
I use (and like) FusionCharts, but I am only developing internal applications so I can control/require what is on my users desktops. If you have a graphing requirement for the mobile browser version (which you may not even have - don't know what your application is), then the Flash requirement wi

[Rails] Re: .html/.html.erb/.rhtml to PDF

2009-07-13 Thread Marnen Laibow-Koser
Peter De Berdt wrote: > On 13 Jul 2009, at 09:55, Sandip Ransing wrote: > >> I wanted to convert .html file into .pdf. >> >> is there any rails plugin ?? Prince looks great if you can afford it. Some of the folks at my local users' group mentioned a couple other options (which I haven't yet

[Rails] Re: Ways to chart data in Rails?

2009-07-13 Thread Marnen Laibow-Koser
Janna Brossard wrote: > But frankly, it really appears to me that fusion charts is the best > looking. Am I mistaken? Do you guys see a better open source solution? I would urge you not to use Fusion Charts. For simple images like charts, there is no need to require your users to install Flash

[Rails] Database Diagram Advice needed plus Normalization

2009-07-13 Thread Älphä Blüë
Hi all, I'm getting into the meat of my application, namely transitional calculations between statistical tables. As a brief overview: 37 categorical statistics tables (independent data from one another) but each belongs to an inheritance_template.rb model with self.abstract_class = true so tha

[Rails] Re: Just a matter of taste or the need of a formal approach?

2009-07-13 Thread Marnen Laibow-Koser
ms wrote: [...] > What to do now? How would you argue? Should I use a join model anyhow > or should I really decide to model the membership in the second way? You should use a junction table and habtm or has_many :through. Repeating fields may seem more intuitively appealing, but they are a ter

[Rails] Re: how to integrate svn with rails

2009-07-13 Thread Marnen Laibow-Koser
gaoxh gaoxh04 wrote: > is there any easy way to do this? > For example, if i type in "ruby script/destroy model user", i have to do > "svn delete filename" for multiple files. If you had read the help text for script/generate and script/destroy, you would know that -c will do what you want. But

[Rails] Re: first app on Dreamhost with Passenger : "rails needs to know your username and password" ?

2009-07-13 Thread John Yerhot
Did you remove index.html from your /public directory? Sounds like it is still there. On Jul 13, 10:35 am, Brian wrote: > I am trying to deploy my first rails app with Dreamhost.  I ftp'd over > my existing app, turned on Passenger and pointed it to my /public > directory.  When I go to 'www.my

[Rails] Re: test problem

2009-07-13 Thread Gavin
Xiahong, The message "Test is not a module" is the error you want to address. I'd check that your test helper doesn't have "include Test" or maybe Test.module_eval someplace in it. :S On Jul 13, 3:15 pm, Xiahong Gao wrote: > Hi everyone, > > I ran into some problems during testing. The prob

[Rails] first app on Dreamhost with Passenger : "rails needs to know your username and password" ?

2009-07-13 Thread Brian
I am trying to deploy my first rails app with Dreamhost. I ftp'd over my existing app, turned on Passenger and pointed it to my /public directory. When I go to 'www.mydomain.com' I get the 'Ruby on Rails: Welcome aboard' default page, including the following: Getting started Here’s how to get r

[Rails] Help with loading data with sequential id

2009-07-13 Thread khagimoto
Hello, I'm trying to load data into my mysql table using the following: load_codes_data.rb require 'active_record/fixtures' class LoadCodesData < ActiveRecord::Migration def self.up down directory = File.join(File.dirname("MY_DIR_NAME"), "data") Fixtures.

[Rails] Re: Controller calling .. ?

2009-07-13 Thread Colin Law
2009/7/13 Hemant Bhargava : > > How can i call a function/method defined in a controller into another > view .. ? Possibly put the method in the model instead. Colin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: New to Rails? Read This

2009-07-13 Thread Marnen Laibow-Koser
Just a few more comments and nitpicks, in the hope of keeping this thread as useful as possible... Älphä Blüë wrote: [...] > > There are numerous SMEs that assist with answering questions by the > minute and it would do well to thank them and be appreciative of their > help. Indeed. (I thin

[Rails] Re: Use of self in a class

2009-07-13 Thread Rick DeNatale
On Mon, Jul 13, 2009 at 6:28 AM, Buzz Hill wrote: > class PaymentType > # Inside a class definition self is the class itself # Note that another equivalent def statement would be # # def PaymentType.get_payment_types # # since PaymentTime also refers to the class itself. >    d

[Rails] Re: Use of self in a class

2009-07-13 Thread Pardee, Roy
> So when you do this: > >class Something > def self.greet >puts "Hello from #{self}!" > end >end > > you're defining a method on the object self -- which happens > to be, at that point in execution, the class object > Something. And just to beat the horse a little more,

[Rails] Re: Conditions don't work

2009-07-13 Thread bill walton
On Mon, 2009-07-13 at 06:46 -0700, pl wrote: > The problem is in the query: > > sqlite> SELECT * FROM "messages" WHERE ("messages"."to" = 3) ORDER BY > created_at DESC; > 23|Hoi Pepijn|7|3|true|2009-07-13 07:40:41|2009-07-13 13:13:45|t > 22|Hoi testje|7|3|true|2009-07-13 07:21:44|2009-07-13 07:33

[Rails] Re: Installing mysql with macports

2009-07-13 Thread Rick DeNatale
On Mon, Jul 13, 2009 at 6:07 AM, mikej wrote: > > Yes, I've tried upgrading and reinstalling Xcode.  Still the same > problem, Not a direct answer to your problem, but... Until recently I was using the macports version of mysql, and was frustrated by things like the OS X MySql preference pane no

[Rails] Re: New to Rails? Read This

2009-07-13 Thread Älphä Blüë
Today's post revolves around communication and SME appreciation. SME's are Subject Matter Experts and every language or platform discussion groups have them. These are generally people that have a great deal of experience and house a wealth of knowledge that they share with others in the comm

[Rails] test problem

2009-07-13 Thread Xiahong Gao
Hi everyone, I ran into some problems during testing. The problem was like: root> ruby test/unit/game_test.rb /usr/lib/ruby/1.8/test/unit/assertionfailederror.rb:7: Test is not a module (TypeError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'

[Rails] Re: how to integrate svn with rails

2009-07-13 Thread gaoxh gaoxh04
is there any easy way to do this? For example, if i type in "ruby script/destroy model user", i have to do "svn delete filename" for multiple files. 2009/7/13 Terry Walker > > Files aren't automatically added or deleted in svn. You have to > explicitly perform an "svn add filename" or "svn dele

[Rails] Re: New to Rails? Read This

2009-07-13 Thread Älphä Blüë
> Almost. AFAIK, autotest used to work with both Rails' built-in tests > and RSpec, but at some point the script was split. So now you use > autospec for RSpec and autotest otherwise. > > Autospec and autotest are part of the ZenTest package, but ZenTest is > more than just those scripts: it

[Rails] mysql error with named_scope and any?

2009-07-13 Thread tonypm
Hi - need some help to pin this one. Am upgrading a project to 2.3.2. Have changed has_finder to named_scope. But I am getting an invalid mysql syntax error with a finder that used to work I have: Batch has_many :orders has_many :line_items, :through=>:orders Order has_many :line_items Lin

[Rails] Re: Conditions don't work

2009-07-13 Thread pl
The problem is in the query: sqlite> SELECT * FROM "messages" WHERE ("messages"."to" = 3) ORDER BY created_at DESC; 23|Hoi Pepijn|7|3|true|2009-07-13 07:40:41|2009-07-13 13:13:45|t 22|Hoi testje|7|3|true|2009-07-13 07:21:44|2009-07-13 07:33:48|f 21|Hoi sjaak|7|3|true|2009-07-13 07:12:19|2009-07-1

[Rails] Re: dynamic paths

2009-07-13 Thread Bob O
Let me see if i can be more clear, and i will try some of the suggested solutions Im trying to make the route paths dynamic. Lets say I have 2 models document, and article I would have paths like document_path(document), documents_path, new_document_path etc... and similar for article article_p

[Rails] Re: ActiveRecord, PostgreSQL question

2009-07-13 Thread gsterndale
Thanks Sijo, I ended up using something very similar: pg_conn = self.connection.instance_variable_get(:@connection) pg_conn.exec("COPY (#{sql}) TO STDOUT WITH CSV HEADER") csv = [] while (line = pg_conn.getline) != "\\." csv << line end pg_conn.endcopy csv.join("\n") It's a hack but it works

[Rails] Re: Running a single fixture.

2009-07-13 Thread Stewart
Well I am not sure if my solution is totally correct but I think I have solved this for now with a simple rake task. I posted http://rtmatheson.com/2009/07/loading-a-single-fixture-in- rails/" >how to run a single fixture in rails on my blog. On Jul 13, 12:22 pm, Stewart wrote: > Hello.  I need

[Rails] Re: observe_field on text_field

2009-07-13 Thread bill walton
On Sun, 2009-07-12 at 21:28 -0700, JannaB wrote: > I dont see anything in firebug that shows me what happens on a get or > post -- just the static snapshot of the page in a nice, expandable > tree view. Firebug has several tabs. The one that shows you the tree you're looking at is the HTML tab.

[Rails] Re: how to integrate svn with rails

2009-07-13 Thread Terry Walker
Files aren't automatically added or deleted in svn. You have to explicitly perform an "svn add filename" or "svn delete filename". -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] Re: Conditions don't work

2009-07-13 Thread bill walton
Hi pl, On Mon, 2009-07-13 at 06:10 -0700, pl wrote: > The strange thing is that Mongrel shows the right query: > Message Load (0.6ms) SELECT * FROM "messages" WHERE > ("messages"."archived" = 'false') AND ("messages"."to" = 3) ORDER BY > created_at DESC > > But I don't see any messages anymor

[Rails] Re: get DB data to rhtml file

2009-07-13 Thread Ar Chron
Mark Preston wrote: > > I got it to work by changing my method in the mystuff_controller to look > like this: > > require 'Mystuff' > > class MystuffController < ApplicationController > > def index > >@my = Mystuff.find( :all) > > end > end > > The only change was to ch

  1   2   >