Re: [Rails] Re: Re: STI and nested object on subclass

2010-09-14 Thread Javier Ruiz
Hi Daniel Thanks for helping :-) This is exactly how I was thinking it should work. But I just tried using set_table_name and I still got the same result, for example, using your code (which is exactly what I'd love to do), I get this: w = Worker.create(:name = WorkerName) # ok p =

Re: [Rails] what I've missed in routes.rb?

2010-09-14 Thread Mauro
On 13 September 2010 21:57, Daniel Gaytán daniel.gaytan.n...@gmail.comwrote: Then it may be set as resource instead of resources or maybe resources :something, :except = :destroy do delete :destroy, :on = :collection, :as = :destroy end If I do resources :sessions, :except =

[Rails] where to get the plugin acts_as_attachment

2010-09-14 Thread Edwin Chen
I tried to get acts_as_attachment. All I get from the website is the link list below. http://svn.techno-weenie.net/projects/plugins/acts_as_attachment/ This link seems not availiable now. Does anyone know about other URL for this plugin? thanks in advance. -- Posted via

[Rails] Mysql2 throws errors on invalid dates. Need suggestion for catching

2010-09-14 Thread Robert Rouse
A dataset I'm working with has bad dates in it (2010-00-09 for example). This causes Mysql2 to throw an error at the adapter level. How am I supposed to catch it so I can handle it correctly? I don't think it fails in ActiveRecord land, so I'm not sure how to handle it. I figured since Rails 3

Re: [Rails] what I've missed in routes.rb?

2010-09-14 Thread Mauro
On 14 September 2010 09:14, Mauro mrsan...@gmail.com wrote: On 13 September 2010 21:57, Daniel Gaytán daniel.gaytan.n...@gmail.com wrote: Then it may be set as resource instead of resources or maybe resources :something, :except = :destroy do     delete :destroy, :on = :collection, :as

[Rails] Re: where to get the plugin acts_as_attachment

2010-09-14 Thread Gcompany
This plugin is now renamed as Restful authentication, available at http://github.com/technoweenie/restful-authentication On Sep 14, 12:20 pm, Edwin Chen li...@ruby-forum.com wrote: I tried to get acts_as_attachment. All I get from the website is the link list

Re: [Rails] Re: Query Multiple tables

2010-09-14 Thread PalaniKannan K
On 13 September 2010 19:54, Jeff cohen.j...@gmail.com wrote: On Sep 13, 6:10 am, Frederick Cheung frederick.che...@gmail.com wrote: On Sep 13, 11:59 am, PalaniKannan K kpalanikan...@gmail.com wrote: Hi, select * from table1 inner join table2 on table1.foreign_key = table2.foreign_key

[Rails] Re: Mysql2 throws errors on invalid dates. Need suggestion for catching

2010-09-14 Thread Wincent Colaiuta
On 14 sep, 07:11, Robert Rouse robert.e.ro...@gmail.com wrote: I know I could fix the data, but I'm not sure when/if another batch will come in like that and I want to make sure my app is bulletproof. Seems like you should fix the data, and add validations to ensure that bad data doesn't get

[Rails] Re: Re: Re: formtastic options

2010-09-14 Thread Jamal Soueidan
radhames brito wrote: sorry i meant to say you can put normal tags in it i have and is works. i want to add more html to the select field. like to buttons to add and remove from the select field. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] rails connection sqlserver 2005 there some wrong!!

2010-09-14 Thread Deng Bin
hi erevy one i use ruby 1.8.7 ,rails is 2.2.2 fisrt get the latest source distribution of Ruby-DBI from: http://rubyforge.org/projects/ruby-dbi/ and copy the file: rub-DBI is 0.2.2 lib/dbd/ADO.rb to: X:/ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb then i install gem install

[Rails] Printing special characters on screen in Ruby

2010-09-14 Thread MDM
I have a website that is working fine, except I cannot get it to print out characters other than plain text. Characters such as ', :, and others like degrees print with the dreaded black diamond with a ? inside. Anyone has any idea as to how I might overcome this. I want to have my website

[Rails] still routes.

2010-09-14 Thread Mauro
Can I do something like that? resources :rusers do resources :deliveries resources :doc_details end Or it is best to do: resources :rusers do resources :deliveries end resources :rusers do resources :doc_details end -- You received this message because you are subscribed to

[Rails] Re: Problems with the money gem

2010-09-14 Thread JSeidel
Martin... It would be more helpful to me if you were to actually describe what you are talking about. If what you are saying is override initialize like so: pre Class Recipe ActiveRecord::Base def initialize (name, yield_amount, yield_unit) self.unit_type = get_unit_type(yield_unit)

Re: [Rails] Roles that are UserProject Based

2010-09-14 Thread radhames brito
with cancan, in your ability model can :manage , Proyect do |proyect| proyect.user = current_user end with this only the proyect's owner is an admin of the proyect and i suggest you create model with the role model gem, there really is no need for a role table. On Tue, Sep 14, 2010 at

Re: [Rails] Re: View and Controllers association

2010-09-14 Thread radhames brito
Post. module is not the same as i.module, i is an instance of the Post class that means you can do Post.name == i.class.name and returns true. acording to ruby docs this is what a module is A Module http://ruby-doc.org/core/classes/Module.html is a collection of methods and constants

Re: [Rails] Re: Re: Re: formtastic options

2010-09-14 Thread radhames brito
there is a plugin to make formtastic work with calendar_date_select go and check the code of the plugin since it does what you want. i bet you can figure out how to do it by checking it out. On Tue, Sep 14, 2010 at 5:33 AM, Jamal Soueidan li...@ruby-forum.comwrote: radhames brito wrote:

[Rails] Re: req: Method executed in link_to

2010-09-14 Thread Jason N
Of course, I should have known that :method was for the HTTP method. Thanks. I guess i just need to write the correct routes now. On Sep 14, 4:28 pm, Srikanth Shreenivas sri...@gmail.com wrote: Reference on link_to

Re: [Rails] rails connection sqlserver 2005 there some wrong!!

2010-09-14 Thread radhames brito
try using bundler to install the gem , it will try to find all the dependencies. http://railscasts.com/episodes/201-bundler On Tue, Sep 14, 2010 at 6:08 AM, Deng Bin li...@ruby-forum.com wrote: hi erevy one i use ruby 1.8.7 ,rails is 2.2.2 fisrt get the latest source distribution of

Re: [Rails] still routes.

2010-09-14 Thread radhames brito
this works resources :rusers do resources :deliveries resources :doc_details end but watch this to clear everything up http://railscasts.com/episodes/203-routing-in-rails-3 http://railscasts.com/episodes/231-routing-walkthrough On Tue, Sep 14, 2010 at 6:54 AM, Mauro

[Rails] Re: Problems with the money gem

2010-09-14 Thread Marnen Laibow-Koser
Jon Seidel wrote: Martin... That's not my name. Look again. It would be more helpful to me if you were to actually describe what you are talking about. I did. If you don't know what a constructor is, then you need to review your basic Ruby in order to use Rails effectively. If what

[Rails] Can't see http://localhost:3000/pages/home in browser

2010-09-14 Thread pauld
Am working my way through the railstutorial.org lesson at http://railstutorial.org/chapters/filling-in-the-layout#top Am not clear about how to start the autotest, and when I tried to see the above page in the broswer, I got this error: Last login: Tue Sep 14 17:06:38 on ttys000

[Rails] Can't see http://localhost:3000/pages/home in browser

2010-09-14 Thread pauld
Am working my way through the railstutorial.org lesson at http://railstutorial.org/chapters/filling-in-the-layout#top Am not clear about how to start the autotest, and when I tried to see the above page in the broswer, I got this error: Last login: Tue Sep 14 17:06:38 on ttys000

[Rails] Re: Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)

2010-09-14 Thread Marnen Laibow-Koser
David Kahn wrote: [...] And why are you using RSpec specs for your controllers, anyway? Cucumber stories are better for that. RSpec is better for model logic. Well, I was hoping to cap new things on this project with Rails 3, ruby 1.9.2, rspec, factory girl. Uh, what? If you need a

[Rails] Re: How to disable a select?

2010-09-14 Thread pepe
   f.select :attr, @choices, :include_blank = true,   :disabled = !...@condition    f.select :attr, @choices, {:include_blank = true},   :disabled = !...@condition    f.select :attr, @choices, {:include_blank = true},   {:disabled = !...@condition} I remember struggling with this a while

[Rails] Re: Printing special characters on screen in Ruby

2010-09-14 Thread Marnen Laibow-Koser
Don Mapp wrote: I have a website that is working fine, except I cannot get it to print out characters other than plain text. *Any* character is plain text. Characters such as ', :, and others like degrees print with the dreaded black diamond with a ? inside. Then your actual encoding is

Re: [Rails] Problem with attr_accessor

2010-09-14 Thread Dave Aronson
Pål Bergström wrote: def crypt_data      self.name = Crypto.encrypt(self.name,key) end def decrypt_data      self.name = Crypto.decrypt(self.name,key) end Are you sure you don't mean @name? This is Ruby, not Python, so self would generally refer to the class or module, not the object.

Re: [Rails] Can't see http://localhost:3000/pages/home in browser

2010-09-14 Thread Dave Aronson
On Tue, Sep 14, 2010 at 08:47, pauld paul.denlin...@gmail.com wrote: Am working my way through the railstutorial.org lesson at http://railstutorial.org/chapters/filling-in-the-layout#top Am not clear about how to start the autotest, and when I tried to see the above page in the broswer, I

[Rails] Re: Problem with attr_accessor

2010-09-14 Thread Marnen Laibow-Koser
Dave Aronson wrote: P�l Bergstr�m wrote: def crypt_data � � �self.name = Crypto.encrypt(self.name,key) end def decrypt_data � � �self.name = Crypto.decrypt(self.name,key) end Are you sure you don't mean @name? This is Ruby, not Python, so self would generally refer to the class or

[Rails] Re: Problem with attr_accessor

2010-09-14 Thread Marnen Laibow-Koser
Pål Bergström wrote: I pass a value from controller to model with attr_accessor. before_save works fine but not after_find. What could be wrong? Note this sentence from the documentation: Unlike all the other callbacks, after_find and after_initialize will only be run if an explicit

[Rails] Re: where to get the plugin acts_as_attachment

2010-09-14 Thread Marnen Laibow-Koser
Edwin Chen wrote: I tried to get acts_as_attachment. All I get from the website is the link list below. http://svn.techno-weenie.net/projects/plugins/acts_as_attachment/ This link seems not availiable now. Does anyone know about other URL for this plugin? thanks in advance. I think most

[Rails] Re: Problems with the money gem

2010-09-14 Thread JSeidel
Sorry, Marnen... Anyway, as I mentioned before, after_create is way too late in the sequence of things to do any good and after_initialize is recommended against (as is after_find) because of performance reasons. I believe I know what a constructor is, so your snide comments continue to be of

[Rails] Problem with tests and cookies

2010-09-14 Thread Albert Llop
Hi, very briefly, this is my interaction in debugger mode in a controller test. I have my test where I initialize some cookies, but then the test itself, when the controller action is executed, fails because even though the cookies are properly set, when accessing them i always get nil. Not sure

[Rails] Overriding object instantiation?

2010-09-14 Thread moonshadow
Hi all, ROR newbie coming from a PHP background here. I have a model that inherits from ActiveRecord::Base. I would like to extend that into two further models, to separate functionality from each other. Basically: class Person ActiveRecord::Base attr_accessible :gender end class Male

[Rails] Re: where to get the plugin acts_as_attachment

2010-09-14 Thread Simon
attachment_fu is the successor of acts_as_attachment. http://github.com/technoweenie/attachment_fu You should also have a look at paperclip. http://github.com/thoughtbot/paperclip On Sep 14, 9:20 am, Edwin Chen li...@ruby-forum.com wrote: I tried to get acts_as_attachment. All I get from the

[Rails] Re: where to get the plugin acts_as_attachment

2010-09-14 Thread Simon Baumgartner
I think you meant acts_as_authenticated. On Sep 14, 9:46 am, Gcompany saurabh.a.bha...@gmail.com wrote: This plugin is now renamed as Restful authentication, available athttp://github.com/technoweenie/restful-authentication On Sep 14, 12:20 pm, Edwin Chen li...@ruby-forum.com wrote: I

[Rails] Singleton user of a given role in Rails 3

2010-09-14 Thread Manish Chakravarty
Hello All, I have a requirement where a site needs to have a Super User and exactly one of those could be created. The flow would be like this - User installs the app - the web app comes up - the first thing that the webapp does it to prompt creation of super user. - the super user is logged in

[Rails] Re: Problems with the money gem

2010-09-14 Thread Marnen Laibow-Koser
Please quote when replying! It's impossible to follow the discussion if you don't. Jon Seidel wrote: Sorry, Marnen... Anyway, as I mentioned before, after_create is way too late in the sequence of things to do any good and after_initialize is recommended against (as is after_find)

[Rails] Re: Overriding object instantiation?

2010-09-14 Thread Frederick Cheung
On Sep 14, 11:31 am, moonshadow equestrian...@gmail.com wrote: How can I write a method within Person that will detect what gender has been defined and return the proper object based on it? I'm thinking something like... def self.new   gender_class = self.gender == 'Female' ? 'Female' :

[Rails] Re: Overriding object instantiation?

2010-09-14 Thread Marnen Laibow-Koser
moonshadow wrote: Hi all, ROR newbie coming from a PHP background here. I have a model that inherits from ActiveRecord::Base. I would like to extend that into two further models, to separate functionality from each other. Basically: class Person ActiveRecord::Base attr_accessible

Re: [Rails] Re: Problem with attr_accessor

2010-09-14 Thread Dave Aronson
On Tue, Sep 14, 2010 at 09:44, Marnen Laibow-Koser li...@ruby-forum.com wrote: That's not true.  In an instance method, self refers to the object. Oops, you're right, on further research it seems to be a slippery little bugger. No wonder I usually see people using @ (or @@) instead -Dave

[Rails] Re: Re: Problem with attr_accessor

2010-09-14 Thread Marnen Laibow-Koser
Dave Aronson wrote: On Tue, Sep 14, 2010 at 09:44, Marnen Laibow-Koser li...@ruby-forum.com wrote: That's not true. �In an instance method, self refers to the object. Oops, you're right, on further research it seems to be a slippery little bugger. Not slippery at all. It's very well

Re: [Rails] Re: Printing special characters on screen in Ruby

2010-09-14 Thread Srikanth Shreenivas
Also, check whether using html escaping helps: %= *h* @picture.description % On Tue, Sep 14, 2010 at 6:31 PM, Marnen Laibow-Koser li...@ruby-forum.comwrote: Don Mapp wrote: I have a website that is working fine, except I cannot get it to print out characters other than plain text.

[Rails] Numericality validation strips chars from original entry

2010-09-14 Thread jdc
I've noticed that if I use the numericality validator and the user enters, for example 1234ABCD it'll come back with a not a number error, but it then fills the input box with 1234, discarding the non- numeric input the user originally put in. I've seen a similar question about this in this

[Rails] undefined method `to_sym' for nil:NilClass

2010-09-14 Thread Commander Johnson
Hi, When updating a ReferralProgram object that has nested Pages in it I get the error in the subject line. Rails generates parameters that look like this: {pages_attributes={0={body=blabla, subject=blabla, id=1}}} When the id parameter is removed like this:

[Rails] Re: belongs_to two different people

2010-09-14 Thread Brian Ablaza
This works, as far as finding both workers and managers for any given task. All CRUD look good. I also need to sort on either the worker name or the manager name, or both. I can't make this work, since there is no actual field named worker.name, for example. My code looks like

[Rails] good hosting for Rails3 ?

2010-09-14 Thread Aldo Nievas
Hi guys any advice about hosting for Rails 3 ? I will need to use a search engine like Sunspot / Solr Heroku ? Slicehost ? Rackspace ? advice will be appreciated. thanks. -- Aldo -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

[Rails] Re: Re: Printing special characters on screen in Ruby

2010-09-14 Thread Marnen Laibow-Koser
Srikanth Shreenivas wrote: Also, check whether using html escaping helps: %= *h* @picture.description % It won't. That's not the issue. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you

Re: [Rails] good hosting for Rails3 ?

2010-09-14 Thread tommy xiao
Rackspace 2010/9/14 Aldo Nievas aldo.nie...@satio.com.ar Hi guys any advice about hosting for Rails 3 ? I will need to use a search engine like Sunspot / Solr Heroku ? Slicehost ? Rackspace ? advice will be appreciated. thanks. -- Aldo -- You received this message because you are

[Rails] Re: good hosting for Rails3 ?

2010-09-14 Thread Marnen Laibow-Koser
Aldo Nievas wrote: Hi guys any advice about hosting for Rails 3 ? I will need to use a search engine like Sunspot / Solr Heroku ? Slicehost ? Rackspace ? advice will be appreciated. I should think any of those would be fine, unless Sunspot won't work on Heroku. thanks. -- Aldo

Re: [Rails] Re: Re: STI and nested object on subclass

2010-09-14 Thread Daniel Gaytán
Hello Javier I don't know what would happen, I installed rails 2.3.9 to try the same code I wrote in rails 3 and worked like a charm. There is something weird in your code since the table name for Person model should be People... I don't know if there is a problem with your ActiveRecord or

[Rails] Re: Roles that are UserProject Based

2010-09-14 Thread nobosh
Thanks for the reply. In the example above I'm not sure where the Admin variable is located? Is that in the User's table as a boolean? The reason for a roles table is that there will be multiple roles (Admin, Member, Viewer, Guest) etc... I tried finding the role model gem but it didn't come up

[Rails] Re: Rails 3: finding a record by name in multilingual app

2010-09-14 Thread Heinz Strunk
Michael Schuerig wrote: with_locale(:en) { Page.find_by_name('Welcome') } Thanks, but there's a little something that makes me not being able to use it. I got another field called content which has the actually content of the page. When I use it with with_locale I get the english content

Re: [Rails] Re: Roles that are UserProject Based

2010-09-14 Thread Daniel Gaytán
http://github.com/martinrehfeld/role_model Enjoy! Daniel Gaytán 2010/9/14 nobosh bhellm...@gmail.com Thanks for the reply. In the example above I'm not sure where the Admin variable is located? Is that in the User's table as a boolean? The reason for a roles table is that there will be

[Rails] Re: How to disable a select?

2010-09-14 Thread pepe
%= f.select :attr,                     @choices,                     {},                     :include_blank = true,                     :disabled = !...@condition % It just happens that I'm working on the very same thing again and the problem with the above is that when the select is not

Re: [Rails] Re: Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)

2010-09-14 Thread David Kahn
Thanks Marnen, I did take your prod and got Cucumber working it was a great day, I think cucumber may even be a bigger win for me than rspec in terms of productivity. On Tue, Sep 14, 2010 at 7:49 AM, Marnen Laibow-Koser li...@ruby-forum.comwrote: David Kahn wrote: [...] And why are you

[Rails] Re: Indexing feature

2010-09-14 Thread Marnen Laibow-Koser
Awijeet Mr. wrote: How can I enable my admin to index the tables, just after he/she makes change into database. The database should take care of its own indexing. Your application normally does not need to worry about this once the indices are set up. Or am I misunderstanding your question?

Re: [Rails] Singleton user of a given role in Rails 3

2010-09-14 Thread radhames brito
this is very easy , but now im busy at work ill post some suggestions in about 3 hours is no one answers On Tue, Sep 14, 2010 at 9:07 AM, Manish Chakravarty manishch...@gmail.comwrote: Hello All, I have a requirement where a site needs to have a Super User and exactly one of those could be

Re: [Rails] Re: Roles that are UserProject Based

2010-09-14 Thread radhames brito
role model is a gem that lets you add roles to the user as a method and saves the role into a field on the user table as a bitmask that is , lets say you have and array like this ROLES = %w[admin moderator author banned] this gord in your user model and you have a field in the user table called

[Rails] how to send raw data from a temp file as a base64 value ?

2010-09-14 Thread Erwin
I am trying to send data from a remote file attachment --- attachment['url'] = http://www.mydomain.com/resource/download/54643; I wrote a class RemoteFile ::Tempfile to fetch to remote data -- remote_file = RemoteFile.new(attachment['url'] ) so, I get a tempfile

[Rails] automatic type casting of query parameters in finds

2010-09-14 Thread Alex May
I'm new to ruby on rails and am using active record 3 to create some object models on top of a postgres db. I have an Environment record with a :name attribute that maps to the :name column of type :string. When I do Environment.find_by_name( abc ), everything works as expected. However, when I

Re: [Rails] Re: Indexing feature

2010-09-14 Thread radhames brito
oops got confused with full text indexing i thought you where talking about sphinx or something like it On Tue, Sep 14, 2010 at 12:46 PM, Marnen Laibow-Koser li...@ruby-forum.comwrote: Awijeet Mr. wrote: How can I enable my admin to index the tables, just after he/she makes change into

Re: [Rails] Re: belongs_to two different people

2010-09-14 Thread Michael Pavling
On 14 September 2010 16:20, Brian Ablaza li...@ruby-forum.com wrote: My code looks like Task.find(:all, :order = worker.name, manager.name) Since both workers and managers are actually in the Person table, I can't see how this could work. Try : Task.find(:all, :include = [:worker,

Re: [Rails] how to send raw data from a temp file as a base64 value ?

2010-09-14 Thread Philip Hallstrom
I am trying to send data from a remote file attachment --- attachment['url'] = http://www.mydomain.com/resource/download/54643; I wrote a class RemoteFile ::Tempfile to fetch to remote data -- remote_file = RemoteFile.new(attachment['url'] ) so, I get a tempfile

Re: [Rails] Re: good hosting for Rails3 ?

2010-09-14 Thread Aldo Nievas
Thanks guys. I will go for Rackspace Cloud option. -- Aldo On Tue, Sep 14, 2010 at 12:31 PM, Marnen Laibow-Koser li...@ruby-forum.comwrote: Aldo Nievas wrote: Hi guys any advice about hosting for Rails 3 ? I will need to use a search engine like Sunspot / Solr Heroku ?

[Rails] Using URLs as resource IDs: how to make work with Apache/Passenger?

2010-09-14 Thread Michael Schuerig
I have a resource whose public ID is a URL. The resulting URLs look like this http://my-app.com/things/http%3A%2F%2Fexample%2Ecom/foo.png I make sure manually, that . in URLs are encoded as %2E. The route looks like this get 'things/:url' = 'things#show' This works just fine with

[Rails] Re: Roles that are UserProject Based

2010-09-14 Thread nobosh
Guys, I appreciate the replies but I'm not trying to assign roles to users. Users can join projects, and users have roles per project Examples: User X belong to Project A with an Admin Role User X belong to Project B with an Guest Role User Y belong to Project B with an Observer Role Does that

Re: [Rails] Re: Roles that are UserProject Based

2010-09-14 Thread Michael Pavling
On 14 September 2010 19:25, nobosh bhellm...@gmail.com wrote: Guys, I appreciate the replies but I'm not trying to assign roles to users. Users can join projects, and users have roles per project I understand what you mean, but can't suggest a solution that I've done myself (as I've tended to

[Rails] Re: Roles that are UserProject Based

2010-09-14 Thread Marnen Laibow-Koser
nobosh wrote: Guys, I appreciate the replies but I'm not trying to assign roles to users. Users can join projects, and users have roles per project Examples: User X belong to Project A with an Admin Role User X belong to Project B with an Guest Role User Y belong to Project B with an

[Rails] Re: Re: Roles that are UserProject Based

2010-09-14 Thread Marnen Laibow-Koser
radhames brito wrote: role model is a gem that lets you add roles to the user as a method and saves the role into a field on the user table as a bitmask that is , lets say you have and array like this ROLES = %w[admin moderator author banned] this gord in your user model and you have a

Re: [Rails] Re: Textmate vs. MacVim

2010-09-14 Thread Rick R
On Thu, Sep 9, 2010 at 3:04 PM, Len Smith ignu.sm...@gmail.com wrote: macvim can be prettier and much more powerful than textmate, and you get the advantage of learning vim and being able to leverage its power on any server you're on. I've been working diligently to 'really try' to use MacVim

Re: [Rails] Re: Textmate vs. MacVim

2010-09-14 Thread Rimantas Liubertas
That's the big problem I'm having with MacVim for Rails.. it just ends up not polished enough. For example I'm using the following plugins: rails plugin, NerdTree, FuzzyFinderTextMate, BufferWipe, and bufmru, and things are just awkward sometimes. For example if I'm in the NerdTree pane and I

[Rails] Re: Roles that are UserProject Based

2010-09-14 Thread nobosh
Hi Marnen, thanks I think that's great. The question is now will CanCan Support that? Are you familiar with CanCan? Something like... (ability.rb) def initialize(user) user ||= User.new if user.role? :super_admin . . end user.rb def role?(role) return

Re: [Rails] Using URLs as resource IDs: how to make work with Apache/Passenger?

2010-09-14 Thread Jeremy Kemper
On Tue, Sep 14, 2010 at 11:13 AM, Michael Schuerig mich...@schuerig.de wrote: I have a resource whose public ID is a URL. The resulting URLs look like this  http://my-app.com/things/http%3A%2F%2Fexample%2Ecom/foo.png I make sure manually, that . in URLs are encoded as %2E. The route looks

[Rails] Re: Newbie: RoR good for Kayak-type site

2010-09-14 Thread Marnen Laibow-Koser
acuitycorp wrote: Hi there, We're a startup looking. A good usage model of our site is something like the travel site Kayak. Lots of searching of database with stale price data, with live crawling of many sites (for lower prices), and various different views of information - a product

[Rails] Re: Newbie: RoR good for Kayak-type site

2010-09-14 Thread nobosh
few thoughts... I've been a ColdFusion dev for years and finally decided to make the move to something better. I actually started with Django, Google's App engine, a few recommendations from friends lured me in. After about 2 weeks I got pretty fed up with Django + App Engine, mainly bec the

[Rails] Re: Roles that are UserProject Based

2010-09-14 Thread Marnen Laibow-Koser
Please quote when replying; otherwise, the discussion is hard to follow. nobosh wrote: Hi Marnen, thanks I think that's great. The question is now will CanCan Support that? I have no idea. Are you familiar with CanCan? No. I've generally used rails_authorization or rolled my own

[Rails] Re: Indexing feature

2010-09-14 Thread Robert Pankowecki (rupert)
On Sep 13, 7:05 pm, Awijeet Mr. li...@ruby-forum.com wrote: How can I enable my admin to index the tables, just after he/she  makes change into database. Just create new controller and execute in index action a sql statement that will return list of database tables. With that you will have live

Re: [Rails] Re: Textmate vs. MacVim

2010-09-14 Thread Rick R
On Tue, Sep 14, 2010 at 3:08 PM, Rimantas Liubertas riman...@gmail.comwrote: Try Command-T: http://www.vim.org/scripts/script.php?script_id=3025 Much better thanks! (Once I figured out it had to be compiled against ruby 1.8.7 :) -- Rick R -- You received this message because you are

[Rails] Re: Having difficulty with threaded comments, using acts_as_tree

2010-09-14 Thread Kelp Kelp
radhames brito wrote: you site crashed because the comment on the page article are found by pulling the article_id from the params but you want to add childrens to a comment and there is no way to pull that id with the find_commentable function I am having trouble following you. I have to

[Rails] Re: Using URLs as resource IDs: how to make work with Apache/Passenger?

2010-09-14 Thread Michael Schuerig
On Tuesday 14 September 2010, Jeremy Kemper wrote: On Tue, Sep 14, 2010 at 11:13 AM, Michael Schuerig mich...@schuerig.de wrote: [...] There is nothing in the app's log. The problem appears to be caused by the / in the :url parameter, even though they are encoded as %2F. I'd prefer if

Re: [Rails] Re: Newbie: RoR good for Kayak-type site

2010-09-14 Thread David Kahn
I am about 1.5 years in to rails and have to say even with catching up with the changes on 3.0, the tools and way of thinking of this community is a reason why I am still writing code and excited because for some reason here on rails even when I hit problems I know there is light at end of tunnel

[Rails] Re: how to send raw data from a temp file as a base64 value ?

2010-09-14 Thread Erwin
Thanks Philip, this is better .. it seems a little bit more complicated that I thought I need to get a file that I download from this url this not the file url, but an html page to download the file attachment['url'] :: http://www.pivotaltracker.com/resource/download/ 579633 and then pass

[Rails] storing a file download in a temp file

2010-09-14 Thread Erwin
In my app, I have an URL to download a file from a remote site , when using this URL in a browser I download the file... http://www.anotherdomain.com/resource/download/579633; but I need to to get the content of this file within my app , as I must encode it and transfer to another app if I use

[Rails] AutoComplete (auto_complete_for)

2010-09-14 Thread Luke
Where is this functionality moved to for Rails 3? I assume I'm no longer supposed to script/install this... More importantly, how should I have been able to figure this out on my own? -- Luke -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] hello

2010-09-14 Thread abdelkarim
Hello every body , i am new in this group and so happy to find a RoR group on the net . I work in some projects in ROR like a web application to administrate the iptables layer on Linux :) I wish that I'm welcome here :) -- You received this message because you are subscribed to the Google

[Rails] Re: Printing special characters on screen in Ruby

2010-09-14 Thread MDM
I am using ruby 2.35. I do not think that that will matter. On Sep 14, 3:57 pm, Srikanth Shreenivas sri...@gmail.com wrote: Also, check whether using html escaping helps: %= *h* @picture.description % On Tue, Sep 14, 2010 at 6:31 PM, Marnen Laibow-Koser li...@ruby-forum.comwrote: Don

[Rails] Re: Printing special characters on screen in Ruby

2010-09-14 Thread MDM
html escaping makes no difference. I have other pages with escaping set and the problem is the same. On Sep 14, 4:25 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: Srikanth Shreenivas wrote: Also, check whether using html escaping helps: %= *h* @picture.description % It won't.  

[Rails] Re: Printing special characters on screen in Ruby

2010-09-14 Thread MDM
In time I will re-write in html 5, but when I originally wrote the website years ago I do not think 4 0r 5 was available. On Sep 14, 3:57 pm, Srikanth Shreenivas sri...@gmail.com wrote: Also, check whether using html escaping helps: %= *h* @picture.description % On Tue, Sep 14, 2010 at 6:31

[Rails] Re: Can't see http://localhost:3000/pages/home in browser

2010-09-14 Thread pauld
Thanks. I missed that with all the commented out information. Paul Denlinger On Sep 14, 9:42 pm, Dave Aronson googlegroups2d...@davearonson.com wrote: On Tue, Sep 14, 2010 at 08:47, pauld paul.denlin...@gmail.com wrote: Am working my way through the railstutorial.org lesson at

Re: [Rails] hello

2010-09-14 Thread Srikanth Shreenivas
Welcome to the world of RoR!!! On Tue, Sep 14, 2010 at 8:01 PM, abdelkarim abdou@gmail.com wrote: Hello every body , i am new in this group and so happy to find a RoR group on the net . I work in some projects in ROR like a web application to administrate the iptables layer on Linux

[Rails] Re: storing a file download in a temp file

2010-09-14 Thread Robert Walker
Kad Kerforn wrote: In my app, I have an URL to download a file from a remote site , when using this URL in a browser I download the file... http://www.anotherdomain.com/resource/download/579633; but I need to to get the content of this file within my app , as I must encode it and

[Rails] script/rails server thin failed

2010-09-14 Thread Difei Zhao
Greetings, I have my rails 3 newly installed, everything seemed working except I tried start thin server: ~/test/rails3_1.9$ script/rails server thin Exiting /var/lib/gems/1.9.1/gems/rack-1.2.1/lib/rack/handler/thin.rb:1:in `require': no such file to load -- thin (LoadError) from

Re: [Rails] script/rails server thin failed

2010-09-14 Thread David Kahn
I hope I am not saying something totally wrong and idiotic but here goes: Is that Ruby 1.9.1 you are using? If I understand Rails 3 wants either 1.8.7 or 1.9.2. Could that be the problem? On Tue, Sep 14, 2010 at 10:12 PM, Difei Zhao li...@ruby-forum.com wrote: Greetings, I have my rails 3

Re: [Rails] Re: Having difficulty with threaded comments, using acts_as_tree

2010-09-14 Thread radhames brito
try to fix the thing i suggested in red and add a parent_id field to the comments table, then make a self referencial associaction or use the acts_as_tree gem, the thing is along with the polimorphic fields a comment should be able to belong to another comment, when you try to make a comment

Re: [Rails] Re: Overriding object instantiation?

2010-09-14 Thread radhames brito
if you put a field called type in the table of the base class AR will automaticly save to the correct class, in fact from that moment on everything will behave as is you had 2 models, no need for more configuration. On Tue, Sep 14, 2010 at 10:20 AM, Frederick Cheung frederick.che...@gmail.com

Re: [Rails] Re: Re: Roles that are UserProject Based

2010-09-14 Thread radhames brito
Why ? i dont see a problem in the case of roles On Tue, Sep 14, 2010 at 2:46 PM, Marnen Laibow-Koser li...@ruby-forum.comwrote: radhames brito wrote: role model is a gem that lets you add roles to the user as a method and saves the role into a field on the user table as a bitmask that is

[Rails] Re: Roles that are UserProject Based

2010-09-14 Thread nobosh
Marnen, in your example models above, permissions is the name of the table correct? that I create? I ended up calling it: projects_users_roles class ProjectsHaveAndBelongToManyUsersWithRoles ActiveRecord::Migration def self.up create_table :projects_users_roles, :id = false do |t|

[Rails] Re: storing a file download in a temp file

2010-09-14 Thread Parker Selbert
Kad Kerforn wrote: In my app, I have an URL to download a file from a remote site , when using this URL in a browser I download the file... http://www.anotherdomain.com/resource/download/579633; but I need to to get the content of this file within my app , as I must encode it and

Re: [Rails] Re: Roles that are UserProject Based

2010-09-14 Thread radhames brito
oh is very easy with cancan and the wiki has eveything you need i recommend making the is() function that says the wiki there are 2 easy ways to set a permission with cancan one is the general way if user.is(:guest) can :read, Article this means that gues user can read articles, all of them

[Rails] Re: Overriding object instantiation?

2010-09-14 Thread Parker Selbert
moonshadow wrote: def self.new gender_class = self.gender == 'Female' ? 'Female' : 'Male' eval(gender_class).new end Really, look into how ActiveRecord handles STI by using the type column. It will handle all of this for you. That said, the way to do something when an object is created

  1   2   >