[Rails] Active record is not releaed used memory

2010-05-18 Thread Manivannanj Jeganathan
I have tried small ruby program like require 'rubygems' require 'postgres' db = PGconn.connect('localhost', 5432, '', '', 'prdjnj','postgres', 'postgres') res=db.exec(select * from users limit 30) res.clear puts After clear result object a=1 while a!=2 end Before running this program,Initial

[Rails] Re: Gem are missing

2010-05-18 Thread Rahul Chaudhari
Ya I did. Even gem got installed but still it give error gem is missing and asking to run rake gems:install On May 18, 12:10 am, Gregor Panek n...@nerdish-by-nature.com wrote: Hi, did you also define your gem in your application environment? Look into environment.rb in config dir. Then

[Rails] no such file to load -- thread (LoadError)

2010-05-18 Thread Rahul Chaudhari
Hi All, I removed all my rails and then ruby installation using sudo apt-get remove and by deleting all gem and ruby folder manually. Then I installed ruby. And tried to install gem(1.3.5 and1.3.6 also) using ruby setup.rb I got following error ./lib/rubygems.rb:9:in `require': no such file to

[Rails] Re: Newby Ruby question, how to I test to know if a method that returns true or false has done so?

2010-05-18 Thread Frederick Cheung
On May 18, 7:41 am, Paul Jonathan Thompson rails...@gmail.com wrote: I am testing for the existence of records on a database. If I use: Mapper.exists?(product.id) How do I test if the condition returned was true or false? I'm not entirely sure what you're asking. Are you just looking for

[Rails] [JOBS] Santa Barbara RoR entrepreneur job opening

2010-05-18 Thread sbclick
Good Afternoon! There is an entrepreneurial job opening in Santa Barbara, CA for individuals who are strong with Ruby on Rails that I wanted to share with you. If the right person for this job is not in Santa Barbara, we will work around that. If this job description matches your skills set,

Re: [Rails] end of file error for net/https

2010-05-18 Thread Zach Moazeni
Not altogether sure what problem you're running into, but http://github.com/jnunemaker/httparty has simplified a lot of my HTTP code. require 'httparty' response = HTTParty.post(https://product-search.api.cj.com/v2/product-search;, :query = {:q = 'ruby}) puts response.body Sometimes server or

Re: [Rails] Re: ActiveResource Mock Objects

2010-05-18 Thread Zach Moazeni
I haven't used HttpMock, but I've used Fakeweb (http://fakeweb.rubyforge.org/) and that will let you setup and reset the registry pretty easily: FakeWeb.clean_registry On May 17, 2010, at 3:52 PM, TomRossi7 wrote: No response? Is anyone using HttpMock? Thanks, Tom -- Zach Moazeni

[Rails] Migration not creating new user object

2010-05-18 Thread Ali
Hi, so I'm new to rails development, and I'm following a book called Practical Rails: Social Networking Sites. There's a user role system that the book develops, each user has a one or more roles and vice versa. So I have the tables users, roles and roles_users (which connects users to roles and

[Rails] Installing Rails in RoR

2010-05-18 Thread anon_comp
I'm trying to install RoR on Windows XP x32 I've tried different variations of installing Rails such as --- gem install rails --include-dependencies INFO: 'gem install -y' is now default and will be removed INFO: use

Re: [Rails] Newby Ruby question, how to I test to know if a method that returns true or false has done so?

2010-05-18 Thread Michael Pavling
On 18 May 2010 07:41, Paul Jonathan Thompson rails...@gmail.com wrote: Mapper.exists?(product.id) How do I test if the condition returned was true or false? Most simply, you would use if... either by wrapping a conditional block around code to run if the condition is met, or with a guard

Re: [Rails] Newby Ruby question, how to I test to know if a method that returns true or false has done so?

2010-05-18 Thread Paul Jonathan Thompson
Thanks for all the replies. It then works just as I had thought but I'm not getting the results that I expect so I need to look a bit further. But I now know that I am using the method correctly. Thanks once again, On 18 May 2010 19:33, Michael Pavling pavl...@gmail.com wrote: On 18 May 2010

Re: [Rails] Newby Ruby question, how to I test to know if a method that returns true or false has done so?

2010-05-18 Thread Michael Pavling
On 18 May 2010 08:42, Paul Jonathan Thompson rails...@gmail.com wrote: Thanks for all the replies. It then works just as I had thought but I'm not getting the results that I expect so I need to look a bit further. But I now know that I am using the method correctly. Thanks once again, If you

Re: [Rails] Re: Re: Agile Web Dev (book) question: errors

2010-05-18 Thread Colin Law
On 18 May 2010 05:04, Orient Fang li...@ruby-forum.com wrote: clanlaw wrote: On 17 May 2010 02:50, Orient Fang li...@ruby-forum.com wrote: cart.rb file as following, � � � �else � � � �...@items CartItem.new(product) � � � �end � �end end -- Are you absolutely certain that is the

[Rails] Re: NameError in CompetitorsController#index

2010-05-18 Thread Manish Nautiyal
Frederick Cheung wrote: On May 15, 9:28�am, Manish Nautiyal li...@ruby-forum.com wrote: class Competitor ActiveRecord::Base Is this in app/models/competitor.rb (case is probably important) ? Fred Yes it in the app/models/competitor.rb -- Posted via http://www.ruby-forum.com/. --

[Rails] Re: NameError in CompetitorsController#index

2010-05-18 Thread Manish Nautiyal
Hassan Schroeder wrote: On Sat, May 15, 2010 at 12:28 AM, Manish Nautiyal li...@ruby-forum.com wrote: I am getting this problem when I run this code in server. In my localhost everything is running fine. But when I deploy my code in the server it shows me the error. �def index �

Re: [Rails] Migration not creating new user object

2010-05-18 Thread Colin Law
On 18 May 2010 06:32, Ali ali.akhtarz...@gmail.com wrote: Hi, so I'm new to rails development, and I'm following a book called Practical Rails: Social Networking Sites. There's a user role system that the book develops, each user has a one or more roles and vice versa. So I have the tables

[Rails] Transaction Failures

2010-05-18 Thread brianp
Hey, I've got a multiple model (4) form on my site. I have the controller handling the creation with a transaction. I do this because if one object can't save I don't want any of them saved and need to be able to quit the entire transaction without making any permanent db calls. The problem I

Re: [Rails] NameError in CompetitorsController#index

2010-05-18 Thread Colin Law
On 15 May 2010 08:28, Manish Nautiyal li...@ruby-forum.com wrote: Hi all I am getting this problem when I run this code in server. In my localhost everything is running fine. But when I deploy my code in the server it shows me the error. I am using FERRET SERARCH IN MODEL. NameError in

[Rails] Pat Shaughnessy's Paperclit problem

2010-05-18 Thread Tom
I'm using Pat Shaughnessy's paperclip http://github.com/patshaughnessy/paperclip cause I need to store pictures in database. When I set :storage = :database in the avatar I get an error when starting server: C:/Ruby/lib/ruby/gems/1.8/gems/paperclip-2.2.6/lib/Paperclip.rb:301:in `[]': Symbol as

Re: [Rails] Migration not creating new user object

2010-05-18 Thread Ali Akhtarzada
Hi, ok so it's fixed now and I have no idea how. I don't know what the console output was the first time I ran the db:migrate command. I tried running it quite a few times after that and it wouldn't output anything new. Anyway, I ran db:reset and everything work now. Just to answer the other

Re: [Rails] Installing Rails in RoR

2010-05-18 Thread ChenJie|抽屉
On Tue, May 18, 2010 at 05:18, anon_comp neocools...@gmail.com wrote: I'm trying to install RoR on Windows XP x32 I've tried different variations of installing Rails such as --- gem install rails --include-dependencies

[Rails] Re: Add all metods in ssl_required

2010-05-18 Thread Federico Fernandez
I found this fork of ssl_required that solves this problem, but I haven't tried it yet: http://github.com/bcurren/ssl_requirement Ryan Wilson wrote: it is too bad one can't just add ssl_required :all Does anyone know how to solve both problems in the best way possible? Thank you!

[Rails] Re: Transaction Failures

2010-05-18 Thread brianp
Found my problem immediately after posting. In: rescue ActiveRecord::RecordInvalid = invalid flash[:notice] = Vehicle was not created @dealer = Dealer.new @user = User.new render :action = new end Should be: rescue ActiveRecord::RecordInvalid = invalid

[Rails] Split the en.yml into multiple files?

2010-05-18 Thread lukas
Hello, I have a problem with my en.yml file in my Rails project: It's getting way too big. Is it possible to split the file up into multiple files, like en_labels.yml, en_hints.yml and so forth? I couldn't find anything so far.. Cheers L. -- You received this message because you are

[Rails] HABTM Blank Join table

2010-05-18 Thread brianp
Based of the declaritive_authorization railscast I've set up a roles table containing 3 role types. A user table and a roles_users table. No matter what I do the join table is always empty. DB: create_table roles, :force = true do |t| t.string role_type t.datetime created_at

[Rails] Re: Split the en.yml into multiple files?

2010-05-18 Thread Frederick Cheung
On May 18, 11:17 am, lukas lukas.zielin...@googlemail.com wrote: Hello, I have a problem with my en.yml file in my Rails project: It's getting way too big. Is it possible to split the file up into multiple files, like en_labels.yml, en_hints.yml and so forth? Take a look at

[Rails] Re: Split the en.yml into multiple files?

2010-05-18 Thread lukas
Ah great, thanks. I just realized it works when I simply split them up like this: en_forms.yml en_labels.yml etc. however, will rails automatically know which one to pic if I f.example add french like this: fr_forms.yml fr_labels.yml ? Or do I have to work with the directory structure as

[Rails] Re: Split the en.yml into multiple files?

2010-05-18 Thread Frederick Cheung
On May 18, 11:52 am, lukas lukas.zielin...@googlemail.com wrote: Ah great, thanks. I just realized it works when I simply split them up like this: en_forms.yml en_labels.yml etc. however, will rails automatically know which one to pic if I f.example add french like this:

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread Aaron Pfeifer
Hey Frank, state_machine actually provides support for executing events using a standard REST interface. Rather than calling the event method directly (such as release!), you can set an the machine's event attribute like so: station.state_event = 'release' station.save! Any event that gets

[Rails] Re: Split the en.yml into multiple files?

2010-05-18 Thread lukas
Yes, I think you're right about the meaninglessness of the filename. Okay, another problem solved. Thanks, Fred! :) On May 18, 1:03 pm, Frederick Cheung frederick.che...@gmail.com wrote: On May 18, 11:52 am, lukas lukas.zielin...@googlemail.com wrote: Ah great, thanks. I just realized it

[Rails] Re: Installing Rails in RoR

2010-05-18 Thread anon_comp
How would I do that? On May 18, 5:35 am, ChenJie|抽屉 cho...@gmail.com wrote: On Tue, May 18, 2010 at 05:18, anon_comp neocools...@gmail.com wrote: I'm trying to install RoR on Windows XP x32 I've tried different variations of installing Rails such as

[Rails] Saving Restful routes path in database

2010-05-18 Thread Joshua Partogi
Dear all, I would like to save a restful resource in the database, and display it as a link on the web page. I tried saving: bar_path(1) into the path column in the table, but unfortunately it doesn't work when I display it like this: %= link_to 'bar', bar.path %  Is this possible with rails?

Re: [Rails] Migration not creating new user object

2010-05-18 Thread Rob Biedenharn
On May 18, 2010, at 1:32 AM, Ali wrote: Hi, so I'm new to rails development, and I'm following a book called Practical Rails: Social Networking Sites. There's a user role system that the book develops, each user has a one or more roles and vice versa. So I have the tables users, roles and

[Rails] Re: HABTM Blank Join table

2010-05-18 Thread Sharagoz
I dont use HABTM much myself, however I dont think this line will work: @user = @dealer.users.create(params[:user].merge(:role_id = 3) Try something like this instead: @dealer = Dealer.create(params[:dealer]) @user = @dealer.users.new(params[:user]) @user.roles Role.find(3) @user.save On May

[Rails] Re: Saving Restful routes path in database

2010-05-18 Thread Tim Shaffer
Should be possible. When you call bar_path(1) it just returns a string like /bar/1 which you can then save in the database. Can you clarify what it doesn't work means when you try this: %= link_to 'bar', bar.path %. Do you get an error? Does it just not output what you expect? That should work

[Rails] Design question

2010-05-18 Thread pepe
I'm working on application where several tables (users,customers,other...) will have the same name structure (prefix, first, middle, last, suffix). I have thought about factoring out the name to a separate model: *** Migrations *** class CreateNames ActiveRecord::Migration def self.up

Re: [Rails] Re: Gem are missing

2010-05-18 Thread Gregor Panek
Very strange, what you could do is to set the path in the config gem to the source directly maybe this works. config.gem 'nameofgem', :source = '.' or to the lib config.gem 'nameofgem', :lib = '' got you errors in your console when trying to require the gem? Am 18.05.2010 um 09:05

[Rails] Re: Design question

2010-05-18 Thread Tim Shaffer
I think I would just stick with putting those columns on each table. Is there a specific problem you're trying to solve by abstracting them out to a separate table? Unless you're trying to remediate a specific issue, this seems like a solution in search of a problem. What would be the

Re: [Rails] Design question

2010-05-18 Thread Tim Lovett
Are customers different than users? Can customers also be users? I'd say you should probably just put the customers and users table into one. You can create a table that links off of users that links them to orders (customers) if the need arises. Or if they are two separate roles can always have

[Rails] Re: Design question

2010-05-18 Thread pepe
Thanks Tim, On May 18, 9:12 am, Tim Shaffer t...@tim-shaffer.com wrote: I think I would just stick with putting those columns on each table. Is there a specific problem you're trying to solve by abstracting them out to a separate table? Unless you're trying to remediate a specific issue, this

Re: [Rails] route conflict - help resolving

2010-05-18 Thread Rick DeNatale
On Tue, May 18, 2010 at 1:16 AM, sso strongsilent...@gmail.com wrote: These are the routes I would like:  map.forums_new_topic 'forums/:forum_id/:subsection_id/topics/ new', :controller = topics, :action = new  map.forums_show_topic 'forums/:forum_id/:subsection_id/:topic_id', :controller =

[Rails] Re: Design question

2010-05-18 Thread Ar Chron
pepe wrote: I have thought about factoring out the name to a separate model: Most of this decision depends on how you intend to treat your Users and Customers. Perhaps you just have people, with a flag attribute on each, or people with related models of Customer-specific info and

[Rails] Re: Design question

2010-05-18 Thread pepe
Thanks Tim, On May 18, 9:15 am, Tim Lovett timo...@gmail.com wrote: Are customers different than users? Can customers also be users? I'd say you should probably just put the customers and users table into one. You can create a table that links off of users that links them to orders

[Rails] Re: Installing Rails in RoR

2010-05-18 Thread anon_comp
Success, it was merely my server blocking gem. Thanks for the help! On May 18, 7:55 am, anon_comp neocools...@gmail.com wrote: How would I do that? On May 18, 5:35 am, ChenJie|抽屉 cho...@gmail.com wrote: On Tue, May 18, 2010 at 05:18, anon_comp neocools...@gmail.com wrote: I'm trying

[Rails] Re: Design question

2010-05-18 Thread pepe
I have used STI before and although it works I am not that crazy about it and in this case I don't think it can be applied because one person *could* be both a user and a customer. I like the concept of the abstract Person model, though. I didn't think about that one and I think it's a good idea.

[Rails] Total number of views - ROR

2010-05-18 Thread Ash
Hey I want to implement functionality which would let me display total number of views for chosen pages. I can create a table to have user_id and page_id for example to keep track of total views. but issue is if there are lot people hitting my page doing so many inserts in table would not be a

[Rails] Re: Design question

2010-05-18 Thread Sharagoz
You could argue for and against this kind of abstraction. By factoring it out you reduce the number of fields in the database, you reduce repetition, you have a model to put name related logic in if there is any and it is easier to implement changes in the naming convention later. The draw back is

[Rails] Re: route conflict - help resolving

2010-05-18 Thread Sharagoz
Shallow routing was added to Rails 2.2, and encourage you to check it out. I never use deeply nested routes myself, because I don't see the point in adding information, that you already have, to the URL. By setting :shallow = true on the resource mappings, this: GET

Re: [Rails] Re: How I can install Heroku Gem?

2010-05-18 Thread Iván Hernández Cazorla
Hello Frederick, I am a newbie in the installation of gem for Ruby, but I try. To install a gem I do this: 1. Open *CMD*. 2. Write the path of my directory when I have the rails apps. In my case, C:\Users\Games\Documents\Ruby\rails_apps\ 3. Then, I go to the carpet *vendor/rails* of

[Rails] !!!! Help With ActiveLdap !!!!

2010-05-18 Thread Leonardo Rente
Hello Guys! I install the ActiveLdap with gem install activeldap and config the ldap.yml, but when I start the app, the console show me this error msg: C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require': wrong number of arguments (2 for 1)

[Rails] Re: Design question

2010-05-18 Thread Kevin Monceaux
On Tue, May 18, 2010 at 06:23:57AM -0700, pepe wrote: I am doing the same with addresses, although I understand the problem is different because a person can have more than one address but not more than 1 name (except for AKAs) or if the person is Jason Bourne... ;) Someone in the witness

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-18 Thread RichardOnRails
Hi Marnen, You'll probably unsurprised to hear that I ran into problems following http://activescaffold.com/tutorials/getting-started. Let's take just one: Getting Started says: = 2. Add this to your layout: %= javascript_include_tag :defaults % %=

Re: [Rails] Re: route conflict - help resolving

2010-05-18 Thread Rick DeNatale
On Tue, May 18, 2010 at 10:32 AM, Sharagoz shara...@gmail.com wrote: Shallow routing was added to Rails 2.2, and encourage you to check it out. I never use deeply nested routes myself, because I don't see the point in adding information, that you already have, to the URL. By setting :shallow

[Rails] XML or YML?

2010-05-18 Thread Scott Holland
Hello, I'm probably being really dumb but I can never figure this out. I want to store things like categories, salutations, image type etc etc but it seems dumb to create a database table for each of these. Is there any way I store this structured data in XML or YML so I can still call:

[Rails] Re: XML or YML?

2010-05-18 Thread chewmanfoo
I'd like to second this request - I found myself fleshing out a lot of the details of my data base structure using categories, salutations, image_types etc tables, which I could then populate via a scaffold, and select in other tables using a collection select. The problem is, when you want to go

[Rails] rails forum maintenance

2010-05-18 Thread Mark
Hi Unfortunately Rails forum is currently riddled with spam. This seems a great shame as the forum is a first port of call for those new to rails, seeking help, and this gives a poor impression of the rails community. I of course realise moderation is completely voluntary work but something

[Rails] Re: Rails3 pre and protect_from_forgery

2010-05-18 Thread Tom Williams
Chaps, Does anyone know if a bug got filed for this issue? Regards, Tom On Apr 9, 9:47 pm, berkelep patrickberke...@gmail.com wrote: I'm experiencing the same issue when implementing Uploadify into a Rails 3.0.0.beta2 application. A comment and a question: 1) You shouldn't need to disable

[Rails] Re: XML or YML?

2010-05-18 Thread Tim Shaffer
The problem is, when you want to go back and alphabetize the categories list, for example, you get the record id's changing, and then an object with a category_id of 12 is now pointing to a different category than it was before (since you reordered the table), which forces you to create

Re: [Rails] Total number of views - ROR

2010-05-18 Thread Gregor Panek
Hi Is this not something for Google Analytics or something similar to that? Hey I want to implement functionality which would let me display total number of views for chosen pages. I can create a table to have user_id and page_id for example to keep track of total views. but issue is

[Rails] Re: route conflict - help resolving

2010-05-18 Thread Sharagoz
You may be right. I thought he was using RESTful routing, but had syntax errors in the manual mappings. On May 18, 4:52 pm, Rick DeNatale rick.denat...@gmail.com wrote: He wasn't using RESTful routing, something which I noticed but decided not to mention in trying to attack his question

[Rails] Looking for Easy Rails hosting

2010-05-18 Thread Mohammed Alenazi
Hi I have registered for some paid rails hosting system that uses cpanel to deploy the rails apps. I could not deploy my app/ I tried several times with no success. Does any one know a good hosting company that provide guidelines or tutorial on how to deploy that rails apps on their servers?

[Rails] Re: Looking for Easy Rails hosting

2010-05-18 Thread Joshua Partogi
IMHO Heroku is pretty simple. Kind regards, Joshua On May 19, 1:22 am, Mohammed Alenazi vb4...@gmail.com wrote: Hi I have registered for some paid rails hosting  system that uses cpanel to deploy the rails apps. I could not deploy my app/ I tried several times with no success. Does any

[Rails] Re: XML or YML?

2010-05-18 Thread scott
http://github.com/binarylogic/settingslogic On May 18, 11:02 am, chewmanfoo chewman...@gmail.com wrote: I'd like to second this request - I found myself fleshing out a lot of the details of my data base structure using categories, salutations, image_types etc tables, which I could then

[Rails] Re: XML or YML?

2010-05-18 Thread Marnen Laibow-Koser
Scott Holland wrote: Hello, I'm probably being really dumb but I can never figure this out. I want to store things like categories, salutations, image type etc etc but it seems dumb to create a database table for each of these. It's not dumb to put these in the database. Is there any

[Rails] Re: XML or YML?

2010-05-18 Thread chewmanfoo
No, I know. what i'm caying is, if you *do* somehow reorder the categories, then your objects which reference them are all re- categorized. that's bad - it's a dependency that is unnecessary. On May 18, 10:15 am, Tim Shaffer t...@tim-shaffer.com wrote: The problem is, when you want to go back

Re: [Rails] Re: XML or YML?

2010-05-18 Thread Michael Pavling
On 18 May 2010 16:28, chewmanfoo chewman...@gmail.com wrote: then your objects which reference them are all re- categorized.  that's bad - it's a dependency that is unnecessary. ?? Only if the somehow you re-order them by is to change the content of the object because you assume id is

[Rails] RForum, the link is broken

2010-05-18 Thread Distriker
Hello, I am very interesting in the RForum of the Ruby Forum, and I see in the footer a link for the official website, but the link is broken. Why? Isn't it possible download more the RForum? Greetings. -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: XML or YML?

2010-05-18 Thread chewmanfoo
what Scott was asking for originally was a way to enumerate options without having to reference their position in a list. if you use a database to create the list, then you necessarily have to reference their position get to them, but if you define the list with, say, a yml file, then position is

Re: [Rails] Total number of views - ROR

2010-05-18 Thread Peter Hickman
I take it that you want this to be real time? Maybe not a database but an in memory hash table like memcached, redis or tokyo cabinet. They have op codes to increment counters that would be atomic operations. -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Controller/Action Problem

2010-05-18 Thread Tobias H.
hey guys, i've got the following problem: i call an action called execute_algorithms. one codeline of this action tries to execute the following command: parser = LibXML::XML::Parser.file(http://localhost:3000/XMLFiles/results.xml;) but it won't work. with an url of a foreign server it works.

[Rails] Re: XML or YML?

2010-05-18 Thread Marnen Laibow-Koser
chewmanfoo wrote: what Scott was asking for originally was a way to enumerate options without having to reference their position in a list. if you use a database to create the list, then you necessarily have to reference their position get to them, but if you define the list with, say, a yml

[Rails] ruby-recaptcha seems be broken or has significant limitation

2010-05-18 Thread Elliott Blatt
I've installed the ruby-recaptcha gem as instructed here: http://bitbucket.org/mml/ruby-recaptcha/wiki/Home Here are the steps that I've comleted: 1. installed the gem 2. added config.gem 'ruby-recaptcha' environment.rb: 4. modified action_controller.rb class ApplicationController

[Rails] Re: XML or YML?

2010-05-18 Thread chewmanfoo
Wow ok. So, the following: Class Shape ActiveRecord::Base attr_accessible :color_id belongs_to :color end Class Color ActiveRecord::Base has_many :shapes end Now, in the console: sh = Shape.last ... sh.color_id 12 sh.color.name red ... c = Color.find(12) c.name = blue c.save! ...

Re: [Rails] Re: XML or YML?

2010-05-18 Thread Robert Calco
I second Tim's observation, but wish to add: From a design perspective, a more generic approach that preserves everything you know and love about AR models is to create the following tables/models: Category id name description abbreviation SystemType id category_id name

Re: [Rails] Re: XML or YML?

2010-05-18 Thread Michael Pavling
On 18 May 2010 16:41, chewmanfoo chewman...@gmail.com wrote: if you use a database to create the list, then you necessarily have to reference their position get to them No - you reference their primary key. This does not equate (unless you have a *very* bad approach to DB design) to position.

Re: [Rails] Re: XML or YML?

2010-05-18 Thread Michael Pavling
On 18 May 2010 16:58, chewmanfoo chewman...@gmail.com wrote: Wow ok. So, the following: Class Shape ActiveRecord::Base  attr_accessible :color_id  belongs_to :color end Class Color ActiveRecord::Base  has_many :shapes end Now, in the console: sh = Shape.last ... sh.color_id 12

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
i suppose state_machine was a bad example to start with (but is my current situation so it was unavoidable)... the example you pointed me to involved changing a collection_select and clicking the save button... i want to instead display different buttons (or links) depending on a users roles and

[Rails] Re: XML or YML?

2010-05-18 Thread chewmanfoo
If it's immutable, then why is it in a database? On May 18, 11:02 am, Michael Pavling pavl...@gmail.com wrote: On 18 May 2010 16:58, chewmanfoo chewman...@gmail.com wrote: Wow ok. So, the following: Class Shape ActiveRecord::Base  attr_accessible :color_id  belongs_to :color

Re: [Rails] Re: XML or YML?

2010-05-18 Thread Michael Pavling
On 18 May 2010 17:07, chewmanfoo chewman...@gmail.com wrote: If it's immutable, then why is it in a database? slaps head in disbelief well... because I find it hard to web-enable these stone tablets :-/ -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: XML or YML?

2010-05-18 Thread chewmanfoo
What I'm saying is, if it's immutable, then you put it in config/ initializers, not in the database. On May 18, 11:11 am, Michael Pavling pavl...@gmail.com wrote: On 18 May 2010 17:07, chewmanfoo chewman...@gmail.com wrote: If it's immutable, then why is it in a database? slaps head in

[Rails] Re: XML or YML?

2010-05-18 Thread Robert Walker
chewmanfoo wrote: If it's immutable, then why is it in a database? What he's saying is that it is immutable by policy. If you have a database that stores orders where each order contains an order number (not a primary key, but rather a number given to a customer), by policy that order number

[Rails] Re: XML or YML?

2010-05-18 Thread Scott Holland
wow, I didn't expect such a response! Maybe I should be storing this data in the db like I am at the moment, it just seem a bit overkill to have a table with: Image_type 1 = Photo 2 = Document 3 = Print There *must* be some way I can define these values in the application and still have all

Re: [Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread Colin Law
On 18 May 2010 17:06, frankjmat...@gmail.com frankjmat...@gmail.com wrote: i suppose state_machine was a bad example to start with (but is my current situation so it was unavoidable)... the example you pointed me to involved changing a collection_select and clicking the save button... i

[Rails] Re: OneLogin releases SAML for Ruby

2010-05-18 Thread Reynard
Hi there, thanks for releasing this toolkit. Does supports both service provider and identity provider initiated web SSO means you can run identity provider service with this toolkit? Also, does anyone have experience with saml2ruby gem? http://rubygems.org/gems/saml2ruby Looks like these are the

[Rails] When I do a migration, the changes are make in the test db

2010-05-18 Thread Jorge alejandro Mendoza torres
When I do a migration, the changes are make in the test database. Does anyone know the reason? In the config/environment.rb file, I have this: ENV['RAILS_ENV'] ||= 'production' And in the db/ folder, it creates a file named test.sqlite3 When I did the migrations, RoR used the test database, but

[Rails] Re: XML or YML?

2010-05-18 Thread Sharagoz
You are right, creating a database table for something like this does feel like overkill. Personally, I often use constants if it's a very small amount of data. class Image VALID_IMAGE_TYPES = ['png', 'gif', 'jpg'] end or IMAGE_TYPES = {:1 = 'Photo', :2 = 'Document', :3 = 'Print'} On May 18,

[Rails] Re: XML or YML?

2010-05-18 Thread Marnen Laibow-Koser
Sharagoz wrote: You are right, creating a database table for something like this does feel like overkill. Personally, I often use constants if it's a very small amount of data. class Image VALID_IMAGE_TYPES = ['png', 'gif', 'jpg'] end Good idea. or IMAGE_TYPES = {:1 = 'Photo', :2 =

Re: [Rails] Re: XML or YML?

2010-05-18 Thread Michael Pavling
On 18 May 2010 17:54, Marnen Laibow-Koser li...@ruby-forum.com wrote: class Image   VALID_IMAGE_TYPES = ['png', 'gif', 'jpg'] end Good idea. Yes - in my own file_attachment object, I use the same constant! :-) -- You received this message because you are subscribed to the Google Groups

[Rails] Re: When I do a migration, the changes are make in the test db

2010-05-18 Thread Frederick Cheung
On May 18, 5:35 pm, Jorge alejandro Mendoza torres li...@ruby- forum.com wrote: When I do a migration, the changes are make in the test database. Does anyone know the reason? In the config/environment.rb file, I have this: ENV['RAILS_ENV'] ||= 'production' And in the db/ folder, it

[Rails] Re: XML or YML?

2010-05-18 Thread Sharagoz
On May 18, 6:54 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: Sharagoz wrote: IMAGE_TYPES = {:1 = 'Photo', :2 = 'Document', :3 = 'Print'} Not a good idea -- why use :1, :2, :3 instead of actual numbers or symbolic keys? Not only is it a bad idea, it's invalid ruby syntax. Integers cant

Re: [Rails] Re: XML or YML?

2010-05-18 Thread thin 2012
On Tue, May 18, 2010 at 10:02 PM, chewmanfoo chewman...@gmail.com wrote: I'd like to second this request - I found myself fleshing out a lot of the details of my data base structure using categories, salutations, image_types etc tables, which I could then populate via a scaffold, and select

[Rails] Rails Database Configuration

2010-05-18 Thread Joshua Martin
I'm building an application in which I'd like groups of users to have their own dedicated MySQL/SQLite database for the application. How can I configure Rails so that ActiveRecord uses that group's dedicated database from the start? -- _ Joshua S. Martin --

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
i'll try another example, maybe it'll be a little clearer - also, ill take SM out of the equation. suppose theres a job edit page... the page has all the job attributes, title, description... etc. but i dont want to change those. i want a button somewhere in the form called mark dupe.. what

[Rails] Re: Rails Database Configuration

2010-05-18 Thread Marnen Laibow-Koser
Joshua Martin wrote: I'm building an application in which I'd like groups of users to have their own dedicated MySQL/SQLite database for the application. How can I configure Rails so that ActiveRecord uses that group's dedicated database from the start? That question comes up fairly

[Rails] CSV parsing/Faster CSV

2010-05-18 Thread Spec Ex
Hello, I'm currently using FasterCSV to parse CSV files. Problem I have is that currently, I have to go through a two step process. I receive the CSV file, I have to open it, and then Save it as CSV (MSDOS) format for FasterCSV to read it without errors. If i try to submit it raw, my application

Re: [Rails] Re: Rails3 pre and protect_from_forgery

2010-05-18 Thread Patrick Berkeley
No idea, sorry. Think I just ended up hacking the session key with a global variable. On 2010-05-18, Tom Williams ceilingf...@gmail.com wrote: Chaps, Does anyone know if a bug got filed for this issue? Regards, Tom On Apr 9, 9:47 pm, berkelep patrickberke...@gmail.com wrote: I'm

Re: [Rails] Controller/Action Problem

2010-05-18 Thread Rob Biedenharn
On May 18, 2010, at 11:43 AM, Tobias H. wrote: hey guys, i've got the following problem: i call an action called execute_algorithms. one codeline of this action tries to execute the following command: parser = LibXML::XML::Parser.file(http://localhost:3000/XMLFiles/results.xml;) but it won't

[Rails] Rails, Paperclip and SWFupload ...

2010-05-18 Thread Ruby on Rails: Talk
Hi I'm sure this is in the wrong group - so any suggestions for a right group would be great! And you have my express permission to treat me like an idiot in replies! I have a fair amount of knowledge ... but ... obviously not enough to understand this past the basics! I have two problems ...

Re: [Rails] Re: XML or YML?

2010-05-18 Thread Rob Biedenharn
On May 18, 2010, at 1:10 PM, Sharagoz wrote: On May 18, 6:54 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: Sharagoz wrote: IMAGE_TYPES = {:1 = 'Photo', :2 = 'Document', :3 = 'Print'} Not a good idea -- why use :1, :2, :3 instead of actual numbers or symbolic keys? Not only is it a bad

Re: [Rails] CSV parsing/Faster CSV

2010-05-18 Thread Rob Biedenharn
On May 18, 2010, at 1:44 PM, Spec Ex wrote: Hello, I'm currently using FasterCSV to parse CSV files. Problem I have is that currently, I have to go through a two step process. I receive the CSV file, I have to open it, and then Save it as CSV (MSDOS) format for FasterCSV to read it without

  1   2   >