Re: [Rails] getting a subdomain name in model.

2011-11-29 Thread Jim Ruther Nill
On Mon, Nov 28, 2011 at 9:11 AM, newrails user newror.u...@gmail.comwrote: Hi all, I am facing problem in getting subdomain name inside the model. The following is my setup. I am using cancan for authorization.I wanted a specific condition in Ability.rb ( the file which is placed in models

[Rails] Unable to Get the Data from SQLite.

2011-11-29 Thread Somnath Mallick
Hi Everyone, I am going through a tutorial of Rails, I have created a database, models and controllers. In the example it says when entering the http://localhost:3000/users/1 URL in the browser it should show the first record in the database in the browser.

Re: [Rails] Unable to Get the Data from SQLite.

2011-11-29 Thread Colin Law
On 29 November 2011 10:30, Somnath Mallick li...@ruby-forum.com wrote: Hi Everyone,   I am going through a tutorial of Rails, I have created a database, models and controllers. In the example it says when entering the http://localhost:3000/users/1 URL in the browser it should show the

[Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Somnath Mallick
Started GET /users/1 for 127.0.0.1 at 2011-11-29 17:19:31 +0530 Processing by UsersController#show as HTML Parameters: {id=1} User Load (0.0ms) SELECT users.* FROM users WHERE users.id = ? LIMIT 1 [[id, 1]] Completed 404 Not Found in 15ms ActiveRecord::RecordNotFound (Couldn't find User

[Rails] Re: Error in ROR App

2011-11-29 Thread Luis Lavena
On Nov 29, 4:04 am, sachin sachinkew...@gmail.com wrote: hi all,  i am new to ROR,I have one ROR app developed in old version i upgrade it with  following version: RubyGems Environment:   - RUBYGEMS VERSION: 1.3.2   - RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] Did you

[Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Luis Lavena
On Nov 29, 9:04 am, Somnath Mallick li...@ruby-forum.com wrote: irb(main):012:0 user.find(1) NoMethodError: undefined method `find' for #User:0x1d401b0         from You should find the class, not the instance: User.find(1) Why doesn't this site have something like code tags or

Re: [Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Colin Law
On 29 November 2011 12:04, Somnath Mallick li...@ruby-forum.com wrote: Started GET /users/1 for 127.0.0.1 at 2011-11-29 17:19:31 +0530  Processing by UsersController#show as HTML  Parameters: {id=1}  User Load (0.0ms)  SELECT users.* FROM users WHERE users.id = ? LIMIT 1  [[id, 1]] Completed

Re: [Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Michael Pavling
On 29 November 2011 12:04, Somnath Mallick li...@ruby-forum.com wrote: irb(main):003:0 user = User.new(:name = Michael Hartl, :email = mha...@example.com) = #User id: nil, name: Michael Hartl, email: mha...@example.com, created_at: nil, updated_at: nil irb(main):006:0 user.save

Re: [Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Michael Pavling
On 29 November 2011 12:18, Colin Law clan...@googlemail.com wrote: On 29 November 2011 12:04, Somnath Mallick li...@ruby-forum.com wrote: ActiveRecord::RecordNotFound (Couldn't find User with id=1):  app/controllers/users_controller.rb:4:in `show' Can you show us the code for users_controller

[Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Somnath Mallick
$ rails console --sandbox Loading development environment in sandbox (Rails 3.1.3) Any modifications you make will be rolled back on exit irb(main):001:0 User.new = #User id: nil, name: nil, email: nil, created_at: nil, updated_at: nil irb(main):002:0 User.first ←[1m←[36mUser Load (0.0ms)←[0m

Re: [Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Michael Pavling
On 29 November 2011 12:30, Somnath Mallick li...@ruby-forum.com wrote: $ rails console --sandbox ermm sandbox? ;-) -- 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

Re: [Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Colin Law
On 29 November 2011 12:30, Somnath Mallick li...@ruby-forum.com wrote: $ rails console --sandbox Loading development environment in sandbox (Rails 3.1.3) Any modifications you make will be rolled back on exit irb(main):001:0 User.new = #User id: nil, name: nil, email: nil, created_at: nil,

[Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Somnath Mallick
OK.. I will give it a try! I think i have to redo all the commands and add data all over again! Currently i get: $ rails console Loading development environment (Rails 3.1.3) irb(main):001:0 User.find(1) ←[1m←[36mUser Load (31.2ms)←[0m ←[1mSELECT users.* FROM users WHERE users.id = ? LIMIT

[Rails] Re: Needs rails developer for a great opportunity!

2011-11-29 Thread Matt Jones
On Nov 28, 2:57 pm, Michael Pavling pavl...@gmail.com wrote: On 28 November 2011 15:37, gojinj...@gmail.com gojinj...@gmail.com wrote: What we offer: we are planning to hit revenue at version 0.7 and definitely will offer a salary once we get there and in the meantime we can discuss for

Re: [Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Michael Pavling
On 29 November 2011 12:47, Somnath Mallick li...@ruby-forum.com wrote: But how come coming out of the sandbox console deletes data from the database? Database values should be persistent right? That is the whole idea of a DB, or am i missing something here? Yes - you're missing the point that

[Rails] image with Content-Type: text/html;

2011-11-29 Thread Mahmoud F.
i have images such as this http://www.cairo360.com/resource.servlet?path=event/6178/event_standard_6178_20112111_542213373.jpeg its Content-Type: text/html; carrierwave dosent recognize it as image is there is any way to fix that ? -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] The requested URL could not be retrieved

2011-11-29 Thread Rafi A
Hi All, I am using the unicorn server for my rails application. When I invoke a HTTP request with the length of query string greater than the acceptable one, I have received the HTTP response code as 400 (Invalid URL) instead of getting the 414 code (The requested URL's length exceeds the

Re: [Rails] Re: Unable to Get the Data from SQLite.

2011-11-29 Thread Colin Law
On 29 November 2011 12:47, Somnath Mallick li...@ruby-forum.com wrote: OK.. I will give it a try! I think i have to redo all the commands and add data all over again! If you have a lot of data to load manually you can do it by putting code in db/seeds.rb then running rake db:seed ... But

[Rails] Run initializer code only on rails server

2011-11-29 Thread Henrique
Hello, Is there a way to run initializer code (in config/initializers) only on rails server, and not on rails console? Thank you! Henrique -- 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: Unable to Get the Data from SQLite.

2011-11-29 Thread Somnath Mallick
I got it working now! Thanks guys! Will be back tomorrow with some other problem! :) -- 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] Graceful degradation/progressive enhancement for ActionMailer templates?

2011-11-29 Thread Jay Levitt
Is there some gem or technique that will let us write only .html.erb templates for our Rails 3 mailers, and gracefully degrade them by stripping HTML tags for the text/plain version, rather than having to create each partial twice? Google is seriously failing me, so I must be searching for the

[Rails] Re: Graceful degradation/progressive enhancement for ActionMailer templates?

2011-11-29 Thread Frederick Cheung
On Nov 29, 3:17 pm, Jay Levitt li...@ruby-forum.com wrote: Is there some gem or technique that will let us write only .html.erb templates for our Rails 3 mailers, and gracefully degrade them by stripping HTML tags for the text/plain version, rather than having to create each partial twice?

[Rails] validations and hashes

2011-11-29 Thread Craig White
Rails 3.1 and I'm working through activeldap which is not exactly ActiveRecord class Group ActiveLdap::Base def validate errors.add(:base, You must enter a value for the 'Common name') unless self.cn.to_s != '' errors.add(:base, You must enter a value for the 'GID Number') unless

Re: [Rails] Re: ActiveRecord::AssociationTypeMismatch

2011-11-29 Thread Gianluca Padovani
Hi to all, I think I have understand the problem. When you made a PUT of this type: playlist id7/id namemetal/name images_attributes type=array image id3/id /image /images_attributes /playlist Rails suppose that: Or your are creating the playlist and the image or you are updating

[Rails] How can I mock the twitter gem?

2011-11-29 Thread spinlock
Hi everyone, I'm trying to write integration tests for my sample twitter app and I'm having trouble mocking out objects in the Twitter namespace. Here's the function that's giving me trouble: def build_twitter(omniauth) Twitter.configure do |config| config.consumer_key = TWITTER_KEY

[Rails] ruby 1.9.2 + csv

2011-11-29 Thread Abhishek shukla
Hello Friends, I have a requirement where I want to create two different sheet in a same csv file. And I want to rename the sheet1 to something. But I am not able to get it. It will be great if someone can help me Thanks Abhishek Shukla -- You received this message because you are

Re: [Rails] image with Content-Type: text/html;

2011-11-29 Thread Dave Aronson
On Tue, Nov 29, 2011 at 08:04, Mahmoud F. li...@ruby-forum.com wrote: i have images such as this http://www.cairo360.com/resource.servlet?path=event/6178/event_standard_6178_20112111_542213373.jpeg its Content-Type: text/html; carrierwave dosent recognize it as image Because text/html isn't

[Rails] gem for storing and tracking changes

2011-11-29 Thread Angelo Cordova
Hi people I want to know which is the best gem or plug-in to store and track register changes for a rails 3.0.9 app Hope you can help me, thanks -- 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

Re: [Rails] ruby 1.9.2 + csv

2011-11-29 Thread Dave Aronson
On Tue, Nov 29, 2011 at 13:18, Abhishek shukla bettera...@gmail.com wrote: I have a requirement where I want to create two different sheet in a same csv file. Does it really have to be multiple sheets? AFAIK there is no standard for how to do that. Maybe it would suffice to have them on one

Re: [Rails] gem for storing and tracking changes

2011-11-29 Thread Colin Law
On 29 November 2011 18:33, Angelo Cordova acord...@gmail.com wrote: Hi people I want to know which is the best  gem or plug-in to store and track register changes for a rails 3.0.9 app It is not clear what it is that is changing (a register?). Is it changes to data in the database or code

[Rails] Re: gem for storing and tracking changes

2011-11-29 Thread Angelo Cordova
On 29 nov, 17:14, Colin Law clan...@googlemail.com wrote: On 29 November 2011 18:33, Angelo Cordova acord...@gmail.com wrote: Hi people I want to know which is the best  gem or plug-in to store and track register changes for a rails 3.0.9 app It is not clear what it is that is

Re: [Rails] Re: gem for storing and tracking changes

2011-11-29 Thread Craig White
On Nov 29, 2011, at 2:11 PM, Angelo Cordova wrote: On 29 nov, 17:14, Colin Law clan...@googlemail.com wrote: On 29 November 2011 18:33, Angelo Cordova acord...@gmail.com wrote: Hi people I want to know which is the best gem or plug-in to store and track register changes for a rails

[Rails] Re: validations and hashes

2011-11-29 Thread Frederick Cheung
On Nov 29, 5:37 pm, Craig White craig.wh...@ttiltd.com wrote: Rails 3.1 and I'm working through activeldap which is not exactly ActiveRecord class Group ActiveLdap::Base   def validate     errors.add(:base, You must enter a value for the 'Common name') unless self.cn.to_s != ''    

[Rails] ajax question

2011-11-29 Thread DmitryS
Hello, could you please explain what's wrong with this code: Rails 3.1.1 skills_controller.rb class SkillsController ApplicationController # GET /skills # GET /skills.json def index @skills = Skill.all respond_to do |format| format.html # index.html.erb

[Rails] Some advice to choose framework for a web application

2011-11-29 Thread Vinh Quốc Nguyễn
Hi, This question may asked so many times. I google about it and got lots of discuss generally. After reading all of them, I go to a conclusion is choose the framework which your understand to it is the most. But we are willing to lean new language or framrwork to make our app better. So we

[Rails] rake doc:rails aborts due to denied permission

2011-11-29 Thread Shazad Rehman
Hi, I issue the following commands: rails new dummy_app cd dummy_app rake doc:rails When issuing the last command I notice that rake aborts due to denied permissions. See below. rm -r doc/api Parsing sources… 100% [485/485] /opt/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails.rb

[Rails] Re: How can I mock the twitter gem?

2011-11-29 Thread Frederick Cheung
On Nov 29, 6:05 pm, spinlock atomicbroadc...@gmail.com wrote: Hi everyone, I'm trying to write integration tests for my sample twitter app and I'm having trouble mocking out objects in the Twitter namespace. Here's the function that's giving me trouble:   def build_twitter(omniauth)    

[Rails] Re: Form helpers and overloaded methods - help!

2011-11-29 Thread Alex Night
i`m in the same situation and did the following in view: %= text_field_tag('book[price]', @book.price) % -- 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: ajax question

2011-11-29 Thread Frederick Cheung
On Nov 29, 7:11 pm, DmitryS dmitry.g.shul...@gmail.com wrote: _skills_list.html.erb div id=skills_list table   tr     thTitle/th     thParent/th   /tr % @skills.each do |skill| %   tr     td%= skill.title %/td     td%= skill.parent_id %/td   /tr % end % /table /div It

Re: [Rails] Re: validations and hashes

2011-11-29 Thread Craig White
On Nov 29, 2011, at 4:25 PM, Frederick Cheung wrote: On Nov 29, 5:37 pm, Craig White craig.wh...@ttiltd.com wrote: Rails 3.1 and I'm working through activeldap which is not exactly ActiveRecord class Group ActiveLdap::Base def validate errors.add(:base, You must enter a value for

[Rails] Re: Some advice to choose framework for a web application

2011-11-29 Thread Dheeraj Kumar
I was a PHP Developer before switching to ROR, and here are some reasons to use RoR. 1. Build a business web application. Of course :) Almost all frameworks can do this nowadays, including RoR 2. Easy to maintain, update. Code is highly readable, and Ruby's core priciples include Developer

[Rails] MS Access integration with Rails through conversion to (Postgres or MySQL) xor direct interaction

2011-11-29 Thread Alec Taylor
Good afternoon, Is there a Ruby ORM gem which integrates with MS Access? Alternatively how would I convert one to PostgreSQL or MySQL then interpret it into ORM syntax for use in Ruby? Thanks for all suggestions, Alec Taylor -- You received this message because you are subscribed to the

[Rails] Re: getting a subdomain name in model.

2011-11-29 Thread peanut
Hi have you tried the method request.subdomain Checkout the railscast on subdomains for more info http://railscasts.com/episodes/221-subdomains-in-rails-3 Bye Rik On Nov 29, 10:44 am, Jim Ruther Nill jvn...@gmail.com wrote: On Mon, Nov 28, 2011 at 9:11 AM, newrails user