[Rails] Re: Associations - Better solution?

2009-07-13 Thread Jitu
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 :auditors has_many :tenants end On Jul 12, 9:43 pm,

[Rails] new gem: renshi - a templating language

2009-07-13 Thread Nicholas Faiz
Hello, Just letting people know about a project of mine - a new templating language; Renshi. See http://github.com/biv/renshi/tree/master . It's also available via gem installation through rubyforge. It was originally modelled on Python's Genshi, although it turned out rather differently. It'd

[Rails] custom error pages

2009-07-13 Thread Rabi Khadka
I need to add custom error pages in my site. But i noticed that i need rescue.rb file in lib/action_controller folder. Can somebody help me how to get that file and how to implement custom error pages please -- Posted via http://www.ruby-forum.com/.

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

2009-07-13 Thread Sandip Ransing
Hello All, I wanted to convert .html file into .pdf. is there any rails plugin ?? Thanks, Sandip R~ -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.com --~--~-~--~~~---~--~~ You received this message

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

2009-07-13 Thread Peter De Berdt
On 13 Jul 2009, at 09:55, Sandip Ransing wrote: I wanted to convert .html file into .pdf. is there any rails plugin ?? http://sublog.subimage.com/2007/05/29/html-css-to-pdf-using-ruby-on-rails However, PrinceXML is not free: http://www.princexml.com/purchase/ That said, it works extremely

[Rails] mailbox model

2009-07-13 Thread Xiahong Gao
Hi everyone, I ran into some problems when modeling mailbox and mails. My code was like: create_table :mailbox do |t| t.integer :user_id # the owner of this mailbox end create_table :mails do |t| t.integer :sender_id t.integer :receiver_id t.string :title t.text :content end class

[Rails] Data-only migrations when User model does not store plain text passwords

2009-07-13 Thread steven_noble
Hi all, How do you create a data-only migration for my User model that adds a password salt and encrypted password to the Users table? Also, my model validates the equivalence of :password and :password_confirmation, neither of which are columns in the Users table. I need my data-only migration

[Rails] Rails Beacon

2009-07-13 Thread Sreenath Somarajapuram
Hi All, Hope am having a new idea for discussion. We can call it 'Rails Beacon'. Rails provide immortal sessions, they don't expire unless we handle it manually. Some sites handle this by closing the session after a fixed time interval from the last server access, some others keep the

[Rails] How to add default value to text_field_with_auto_complete

2009-07-13 Thread Thriving K.
I can't find the way in rails api of how to add default value in text_field_with_auto_complete. Anyone know please teach me. Thank you. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

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

2009-07-13 Thread Felix Schäfer
Am 13.07.2009 um 11:40 schrieb Thriving K.: I can't find the way in rails api of how to add default value in text_field_with_auto_complete. Anyone know please teach me. I come up with this after 20s of googling: text_field_with_auto_complete foo, bar, :tag_options = { :value = some

[Rails] Controller calling .. ?

2009-07-13 Thread Hemant Bhargava
How can i call a function/method defined in a controller into another view .. ? -- 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

[Rails] Re: Installing mysql with macports

2009-07-13 Thread mikej
Yes, I've tried upgrading and reinstalling Xcode. Still the same problem, Mike --~--~-~--~~~---~--~~ 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

[Rails] Disable session cookie during a request

2009-07-13 Thread Alex
My code makes extensive use of sessions for things like the logged in user. I have added a stateless API that authenticates on each request, but it uses underlying code that sets session data. In the stateless case, the session is populated on each request. I don't want it persisted. Is there

[Rails] Re: Use of self in a class

2009-07-13 Thread Buzz Hill
JangoSteve wrote: In other words, you just use def get_payment_types if get_payment_types is to be performed on a specific instance of that class, and def self.get_payment_types if it is just a generic function for that class... I guess what I am confused about is this: Dave Thomas talks

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

2009-07-13 Thread Thriving K.
Thank you a lot, i will try harder next time -- 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

[Rails] Re: Associations - Better solution?

2009-07-13 Thread Pradeep Gatram
You can try something on these lines too class User ActiveRecord::Base has_many :audits_as_auditor, :class_name = 'Audit', :foreign_key = 'auditor_id' has_many :audits_as_tenant, :class_name = 'Audit', :foreign_key = 'tenant_id' end Pradeep On Jul 13, 11:07 am, Jitu

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

2009-07-13 Thread paron
There's Scruffy, http://scruffy.rubyforge.org/ , of course. I don't see the animations and gradients and such, though. They're all possible in SVG, but unfortunately, I can't say it's as easy as the Flash-based stuff. It seems that programmer graphics tend to have a There, I fixed it look to

[Rails] Re: Use of self in a class

2009-07-13 Thread David A. Black
Hi -- On Mon, 13 Jul 2009, Buzz Hill wrote: JangoSteve wrote: In other words, you just use def get_payment_types if get_payment_types is to be performed on a specific instance of that class, and def self.get_payment_types if it is just a generic function for that class... I guess what I

[Rails] How to manage Tab Comma separated filds form single text f

2009-07-13 Thread Bhupendra Chaudhari
Hi, I am modifying on script. I am using this script to import data form text-delimited file into PosgresSql database. I have already setup a code for tab separation but facing problem in comma separation. In text-delimited file there is foulr field which are inter related. first organization

[Rails] What is dispatch.rb?

2009-07-13 Thread Pål Bergström
What is the file dispatch.rb for? I also have dispatch.cgi and dispatch.fcgi. Running on LiteSpeed Web Server -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: Data-only migrations when User model does not store plain text passwords

2009-07-13 Thread steven_noble
In case anyone has a similar problem, a workaround is to populate your Users table using seed_fu: http://github.com/mbleigh/seed-fu/tree/master s. On Jul 13, 6:19 pm, steven_noble ste...@snoble.net wrote: Hi all, How do you create a data-only migration for my User model that adds a

[Rails] Re: Data-only migrations when User model does not store plain text passwords

2009-07-13 Thread steven_noble
In case anyone else has this a problem, a work-around is to popular the Users table using seed_fu. Then you can just pass it the :password and :password_confirmation, and your app takes care of generating the salted versions etc. s. On Jul 13, 6:19 pm, steven_noble ste...@snoble.net wrote: Hi

[Rails] Re: Problem deploying app on bluehost

2009-07-13 Thread Roger Pack
I want to know if i can get a similar deal with better hosting provider , can I get something good for ror applications for ard 50$ an year. I think dreamhost is similar. And hopefully easier. =r -- Posted via http://www.ruby-forum.com/.

[Rails] Running a single fixture.

2009-07-13 Thread Stewart
Hello. I need to run a single fixture on my server as part of an update to my application. I noticed that the other tables lost their data when I run rake db:fixtures:load. How do I make it so that only a single fixture runs and ignores the rest?

[Rails] Re: How to manage Tab Comma separated filds form single text f

2009-07-13 Thread Bhupendra Chaudhari
Please find more below more hints on what the code is : begin f.read.each do |l| if counter 0 tokens = l.split(/\t/).collect{|ss| ss.delete(\) } #tokens1 = l.split(/, /) #tokens2 = l.split(/, /)

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

2009-07-13 Thread Michael
Thanks very much. Could you give me some more advice how can I do this?I still don't know how to join the two tables...thanks again. You need to joins the users table if you want to order by a column on it. Fred in the article.rb: belongs_to :user named_scope :by_user_value,:order =

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

2009-07-13 Thread ms
Hi, thanks for reading this post. At the moment, I am thinking about the following problem: Let's assume the following situation: I've got two entity types called User and Group. Each entity type got some attributes, let's think about name and password for User and name as well as type for

[Rails] how to integrate svn with rails

2009-07-13 Thread Xiahong Gao
Hi everyone, I am a newbie on rails. I tried to use svn to control my code version. However, I found the following problems: When I typed in ruby script/generate scaffold product, the added files were not applied in svn. The same problem occurred when I deleted some files by typing in ruby

[Rails] VALIDATION HELP

2009-07-13 Thread Newb Newb
hi all, i have a array of text_field_tags in my Edit form like below % @name_list.each do |k|% Name %= text_field_tag names[#{k.id}],#{k.name}% %end% I want to do modal validation for this form. Any ideas or suggestions to try validation for array of fields Thanks in advance -- Posted via

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

2009-07-13 Thread Ar Chron
Investigate polymorphic join relationships... you can join arbitrary numbers of other 'things' without adding foreign_keys to your base table (User). A new 'thing' just has to participate in the poly join relationship. Requirement (these can be related to any number of other entities,

[Rails] Conditions don't work

2009-07-13 Thread pl
Hi there, I'm building a private message system for one of my sites. I'm now trying to give users the delete messages in their inbox (not destroy the records but put archived = true in them), so they don't come up anymore. This is important because the sender needs to have the message in his

[Rails] Re: Controller calling .. ?

2009-07-13 Thread Codeblogger
Hermant, this sounds lika a violation of the MVC pattern. You might want to rethink your design. Regards Nicolai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group,

[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 change the name of

[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 anymore (archived and

[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: 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 a href=http://rtmatheson.com/2009/07/loading-a-single-fixture-in- rails/ how to run a single fixture in rails/a on my blog. On Jul 13, 12:22 pm, Stewart

[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 for

[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

[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-13

[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

[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] 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 rails-mailing-l...@andreas-s.net Files aren't automatically added or deleted in svn. You have to explicitly perform an svn

[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: 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

[Rails] Re: Installing mysql with macports

2009-07-13 Thread Rick DeNatale
On Mon, Jul 13, 2009 at 6:07 AM, mikejmikejerem...@gmail.com 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

[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:48|f

[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, that is

[Rails] Re: Use of self in a class

2009-07-13 Thread Rick DeNatale
On Mon, Jul 13, 2009 at 6:28 AM, Buzz Hillrails-mailing-l...@andreas-s.net 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

[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 think

[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)

[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

[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 gaox...@gmail.com wrote: Hi everyone, I ran into some problems during

[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 brifo...@gmail.com 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

[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: 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

[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

[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] 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 tried):

[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

[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 =

[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

[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

[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 kumi.hagim...@gmail.com wrote: Hello, I'm trying to load data into my mysql table using

[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

[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 bhan...@hcinsight.com wrote: Let me see if i can be more clear, and i will try some of the suggested solutions Im

[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 to the

[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 rails-mailing-l...@andreas-s.net 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

[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

[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 ... klass.foo = bar klass[foo] = bar klass[foo] = biz = biz klass[foo] = biz klass.foo = biz

[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

[Rails] Re: Controller calling .. ?

2009-07-13 Thread Hemant Bhargava
Thanks Champs .. Got it .. :) Colin Law wrote: 2009/7/13 Hemant Bhargava rails-mailing-l...@andreas-s.net: 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] 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

[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: 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: 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

[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 brifo...@gmail.com wrote: Nope, it's still there.  Now I really feel like a dork.  Also, my regular 'starting point' I had been using was a

[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 butler.bria...@gmail.com 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

[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.

[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:

[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

[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

[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] 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

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Colin Law
2009/7/13 Josh joshbwh...@gmail.com: 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.

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

2009-07-13 Thread Colin Law
2009/7/13 Renzo renz.perez.mend...@gmail.com: 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..

[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

[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: 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] 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

[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, 刘子嘉 xxmikl.m...@gmail.com

[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 p...@betterrpg.com wrote: Hi all, I found what I

[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

[Rails] Re: Time Converstions Issues

2009-07-13 Thread Hassan Schroeder
On Mon, Jul 13, 2009 at 2:38 PM, Matt Jonesal2o...@gmail.com 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

[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 :auditors has_many

[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: 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 Web

[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

[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

[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 rails-mailing-l...@andreas- s.net wrote: Yeah, I should have mentioned that sorry.

  1   2   >