[Rails] authenticate not working in rails

2012-03-29 Thread amvis
i have this code * user_name=auth_decoded[0]* * password=auth_decoded[1]* * @user = User.find_by_email(user_name)* * if (@chkuser= (@user && @user.authenticate(password)))* The above snippet is not working, any solution...? Thank you vishnu -- You received

Re: [Rails] Re: Updating to 3.2.3.rc1 failing

2012-03-29 Thread Abram
You aren't going to believe this but I was having a vacant moment and forgot to update my gemfile... Will do rc2 now. Thanks so much Peter for your response. Cheers, Abram On Fri, Mar 30, 2012 at 2:12 AM, Alex Mercer wrote: > Can you take calm and wait couple days.. > Tomorrow should be 3.2.3 f

[Rails] Re: Unable to deploy to Apache

2012-03-29 Thread Kal
Hi Walter, I did as instructed but now getting a "rake aborted! stack level too deep (in /home/rubys/work/depot/app/assets/stylesheets/ scaffolds.css.scss)" error. I tried to modify "config.assets.compile = true: (from false) within config/environments/production.rb but still no good :( Thanks A

[Rails] Re: Unable to deploy to Apache

2012-03-29 Thread Kal
Hi Walter, I did as instructed but now getting a "rake aborted! stack level too deep" error (in /home/rubys/work/depot/app/assets/stylesheets/ scaffolds.css.scss). I also tried modified "config.assets.compile = true" (from false) within config/environments/production.rb but still no good :( Than

Re: [Rails] Re: Unable to deploy to Apache

2012-03-29 Thread Walter Lee Davis
On Mar 29, 2012, at 10:51 PM, Kal wrote: > (Re-posting) > > Thanks Walter, > > I think you are correct. I had neglected to set up a production > version of the database. > > I just ran "rake db:migrate RAILS_ENV=production". However, I now get > a "500 Internal Server Error". > > Anyway, he

[Rails] Re: Unable to deploy to Apache

2012-03-29 Thread Kal
(Re-posting) Thanks Walter, I think you are correct. I had neglected to set up a production version of the database. I just ran "rake db:migrate RAILS_ENV=production". However, I now get a "500 Internal Server Error". Anyway, here is the error from production.log. Any ideas? Thanks, Kal -

[Rails] Re: Unable to deploy to Apache

2012-03-29 Thread Kal
Hi Leonardo, Per my reply to Walter, I just ran "rake db:migrate RAILS_ENV=production". However, I now get a "500 Internal Server Error". Below is my config/database.yml file and these are the permissions to the db/production.sqlite3 file. -rw-r--r-- 1 root root 5120 Mar 29 20:45 production.sq

Re: [Rails] ActiveRecord Bug — Dropped Connection with two conditions

2012-03-29 Thread thiagocifani
I don't know what are trying to do, but why are you not using arel approach for 2 conditions statements, You could try this possibility users.where(users[:name].eq('bob').and(users[:age].lt(25))) if you have any misunderstand please try to look at arel documentation or github readme https://git

RE: [Rails] installing ruby and rails framework

2012-03-29 Thread Jason White
If you need to stay on windows, you can use the rails installer from http://railsinstaller.com. It makes setting up a development environment on windows simple. You may have issues with some gems in the future, but this will get you started. Also take a look at http://railstutorial.org, it's an exc

Re: [Rails] installing ruby and rails framework

2012-03-29 Thread Javier Quarite
Take a look at this http://ruby.railstutorial.org/ but, I recommend you to use ubuntu. Sometimes you may find some troubles in windows JavierQ -- 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 rubyonr

[Rails] installing ruby and rails framework

2012-03-29 Thread danny danny
My name is dany, i from indonesia. i have some priority question about this program ruby and rails framework.. 1. I can not understand how installing ruby and the rails framework also the devkit in github with the good guidelines, many resource in the google, but nothing can helping me because the

[Rails] Re: Not sure about event machine workings

2012-03-29 Thread wbsurf...@yahoo.com
Your post has been very helpful, I tried something like what you posted, but it didn't quite make sense to me. If you look at what I have currently below, I have to have this sleep(30) at the bottom which is not optimal. a join on the thread doesn't work. I also tried run_block() instead of run

[Rails] ActiveRecord Bug — Dropped Connection with two conditions

2012-03-29 Thread Seth Willits
Using 3.2.2, doing: a = Model.where("created_at > '2011-10-01 00:00:00'").where("created_at < '2012-01-01 00:00:00'") Always results in ActiveRecord::StatementInvalid (Mysql2::Error: Lost connection to MySQL server during query: SELECT `models`.* FROM `models` WHERE (created_at > '20

Re: [Rails] Unable to deploy to Apache

2012-03-29 Thread Leonardo Mateo
On Wed, Mar 28, 2012 at 9:56 PM, Kal wrote: > Hi All, > > Can someone please help?  I've been banging my head against for wall > for 2 months; all of which has been spent trying to set up ROR.  So I > actually haven't written 1 line of code :(  Any help would be greatly > appreciated :) > > I'm fo

[Rails] controller missing - locale

2012-03-29 Thread Christopher Jones
Hi all, I am having a problem at the moment with my code in which if I incase my routes with scope '(:locale)' do buy I get the error controller missing, any ideas why? Games::Application.routes.draw do scope '(:locale)' do get "game_interest/new" get "rules/index" get "feedback/index" ge

[Rails] Re: Help Converting from SQL to Rails syntax

2012-03-29 Thread John Hinnegan
worth noting, since I could have '000's of records, the point of this is to avoid having to load the ids I want to delete into the app and let the DB optimize for it. On Thursday, March 29, 2012 1:52:45 PM UTC-7, John Hinnegan wrote: > > Hi all, > > I have a table where I'm deleting sparse recor

[Rails] Help Converting from SQL to Rails syntax

2012-03-29 Thread John Hinnegan
Hi all, I have a table where I'm deleting sparse records -- basically cleaning up broken has_many / belongs_to relationships. (How we get into this situation is a trade-off. We can have '000's of records, and deletes generally happening during peak load, so we just do the clean up later.) I ha

Re: [Rails] Deploying RoR app

2012-03-29 Thread radhames brito
On Thu, Mar 29, 2012 at 3:51 PM, João Afonso wrote: > Server uses Plesk; as far as I know, I am only able to use a file > explorer, or access files via ftp. Even with the proper alternatives, > please explain what's needed to make that copy/past deployment. > Thanks in advance > > If you only have

Re: [Rails] Unable to deploy to Apache

2012-03-29 Thread Walter Lee Davis
On Mar 28, 2012, at 8:56 PM, Kal wrote: > Hi All, > > Can someone please help? I've been banging my head against for wall > for 2 months; all of which has been spent trying to set up ROR. So I > actually haven't written 1 line of code :( Any help would be greatly > appreciated :) > > I'm fol

[Rails] Rails 3.2 and Streaming using response_body

2012-03-29 Thread Matthew Fordham
I am working on a streaming download (CSV) from Rails 3.2 and am coming up against an issue of the initial page request taking a long time. The following controller code illustrates my issue: self.response_body = Enumerator.new do |y| 10_000_000.times do y << "Hello Wor

[Rails] Re: Deploying RoR app

2012-03-29 Thread SeanRoberts
Using FastCGI to run your Rails application has been more or less abandoned. As another poster said, your best bet is to probably get up and running on Heroku. If you can't do that, you'll want to look at installing Passenger (AKA mod_rails). A web host that is suggesting that you use FastCGI to

[Rails] Rails 3 association with order by field with belongs to relation

2012-03-29 Thread chiru4all
Hi, I have three model subject, document_types and document. class Subject < AR has_many :documents end class DocumenType < AR has_many :documents end class Document < AR belongs_to :subject belongs_to :document_types end I need to

[Rails] Unable to deploy to Apache

2012-03-29 Thread Kal
Hi All, Can someone please help? I've been banging my head against for wall for 2 months; all of which has been spent trying to set up ROR. So I actually haven't written 1 line of code :( Any help would be greatly appreciated :) I'm following the 4th edition of "Agile Web Development with Rail

Re: [Rails] Deploying RoR app

2012-03-29 Thread João Afonso
Server uses Plesk; as far as I know, I am only able to use a file explorer, or access files via ftp. Even with the proper alternatives, please explain what's needed to make that copy/past deployment. Thanks in advance 2012/3/29 radhames brito > FastCGI used to be a way to deploy Rails a couple o

Re: [Rails] Deploying RoR app

2012-03-29 Thread radhames brito
FastCGI used to be a way to deploy Rails a couple of years ago. What are you allowed to do in the server? And yes there is a copy/paste way to deploy but is not recommended. Please post more details about your hosting solution. -- You received this message because you are subscribed to the Google

Re: [Rails] Not sure about event machine workings

2012-03-29 Thread radhames brito
When you enter a eventmachine block it never return control to your app. You have to turn it on but dont stay inside the evented block. Use this method before initializing comunication to faye def self.ensure_reactor_running Thread.new { EM.run } unless EM.reactor_running? sleep 0

[Rails] Not sure about event machine workings

2012-03-29 Thread wbsurf...@yahoo.com
I found this example of using faye for a chatroom type app as I am trying to get a feel for push servers: http://net.tutsplus.com/tutorials/ruby/how-to-use-faye-as-a-real-time-push-server-in-rails/ I got some of that to work, although multiuser from the same browser doesn't exactly make sense. I

[Rails] Re: minitest validations - is there a cleaner way?

2012-03-29 Thread William H. H.
Oh fun, just found out def validate doesn't quite work like that anymore in rails3, so never mind on the first question, I need to change my def validate method. An example of an association test would still be crazy helpful tho. Here's what I used to do with spec and shoulda: it { should have

[Rails] Re: distinctively difficult to do what I want

2012-03-29 Thread bingo bob
Schema attached.. model summaries... class Name < ActiveRecord::Base attr_accessible :given, :gender, :position has_many :user_names has_many :users, :through => :user_names class UserNames < ActiveRecord::Base belongs_to :user belongs_to :name class User < ActiveRecord::Base #

[Rails] [ANN] Rails 3.2.3.rc2 was released!

2012-03-29 Thread Santiago Pastorino
Rails 3.2.3.rc2 has been released. ### IMPORTANT Rails 3.2.3 introduced a new option that allows you to control the behavior of remote forms when it comes to `authenticity_token` generation. If you want to fragment cache your forms, authenticity token will also get cached, which isn't acceptable.

[Rails] Re: minitest validations - is there a cleaner way?

2012-03-29 Thread William H. H.
Carlos, I love the way you are testing this. I have a question tho. When I tried implementing something similar in my tests, it doesn't seem to be running the validations I set in the def validate function of my model. Can you think of any reason why this might be happening or how I should alt

Re: [Rails] Deploying RoR app

2012-03-29 Thread Leonardo Mateo
On Tue, Mar 27, 2012 at 3:25 PM, ja wrote: > Good evening. > I've consulted wikis, old threads, forums, everything, in order to > understand/find a way to deploy RoR with minimum effort. > I've developed it using WebBrick to check functionality; now I want to > deploy it in a net apache server (us

[Rails] Re: Re: Re: Re: distinctively difficult to do what I want

2012-03-29 Thread bingo bob
Thanks Colin, I'm giving this a go but running into problems. Is there a problem perhaps with using the join table name of UsersNames or UserNames as it might clash with the User.username attribute. I'll post my code later - just wondering does the name of the join table matter at all ? I wro

[Rails] Re: Unable to install rubygems

2012-03-29 Thread Alex Mercer
Seems you have problem with some dependence gem. Can you show output of: gem install -V mongrel On Thursday, March 29, 2012 6:49:24 AM UTC+3, Loganathan Sellappa wrote: > > HI All, > > I had installed the ruby 1.8.7 with patch level 253 successfully on my > ubuntu 10.04, but while installing ruby

[Rails] dates early 1970

2012-03-29 Thread Edu Mariano
do anyone knows how to allow < 1970 dates in sql-server-adapter version 2.3.14? Thanks in advance Edu -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-

[Rails] Re: Updating to 3.2.3.rc1 failing

2012-03-29 Thread Alex Mercer
Can you take calm and wait couple days.. Tomorrow should be 3.2.3 final release =_) On Thursday, March 29, 2012 10:44:25 AM UTC+3, Abram wrote: > > Right, the code below should explain everything. This is taken from > ubuntu's console. As you can see I can't seem to update my rails > version. Yes,

Re: [Rails] rspec: mocking a reference to a polymorphic model?

2012-03-29 Thread David Chelimsky
On Thu, Mar 22, 2012 at 7:23 AM, Fearless Fool wrote: > The basic question: how do you mock (or stub) a reference to a > polymorphic class in RSpec?  Trying the obvious thing leads to an error > of the form: > >   undefined method `base_class' for Post:Class > > === The details: > > # file: app/mo

Re: [Rails] Best place for RSpec/Rails questions?

2012-03-29 Thread David Chelimsky
On Thu, Mar 22, 2012 at 1:12 PM, Pito Salas wrote: > I've tried a question on StackOverflow and on > http://www.ruby-forum.com/forum/rspec. Are those the best sources for > rspec-in-rails questions, or should I post in the Rails forum itself? > Anyone have an opinion? http://rubyforge.org/mailman

[Rails] Returning all fields indexed in solr using acts_as_solr

2012-03-29 Thread Jo Mu
Hello, I am new to Ruby and Rails. I have an application that I would like to add searching. I am using acts_as_solr for this. To search I do: @results = Model.find_by_solr(params[:q]) However results contain only the primary key and score. It doesn't contains other fields. The Solr log shows:

[Rails] Arbitrarily nesting some attributes in rabl

2012-03-29 Thread Keren Yaniv
Hi, I'm designing a new API for my project, and I want to return objects that have nested children as json. For that purpose i've decided to use RABL. I want the client side to be able to understand whether the object is valid, and if not which fields are missing in order to save it correctly. Th

[Rails] Re: How to add data-some thing with link_to method

2012-03-29 Thread Karthikeyan A k
Thanks a lot! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-t

Re: [Rails] Updating to 3.2.3.rc1 failing

2012-03-29 Thread Peter Vandenabeele
On Thu, Mar 29, 2012 at 8:44 AM, Abram wrote: > Right, the code below should explain everything. This is taken from > ubuntu's console. As you can see I can't seem to update my rails > version. Yes, I have the same problem after preceding with 'sudo' ... > Thanks for the help ! > > funkdified@funk

[Rails] Updating to 3.2.3.rc1 failing

2012-03-29 Thread Abram
Right, the code below should explain everything. This is taken from ubuntu's console. As you can see I can't seem to update my rails version. Yes, I have the same problem after preceding with 'sudo' ... Thanks for the help ! funkdified@funkdified-laptop:~/railsprojects/goodsounds$ gem install rail

Re: [Rails] Model associations and arrays of hashes

2012-03-29 Thread Colin Law
On 27 March 2012 22:10, @jikche wrote: > Hi everyone, I'm new to ruby/rails and trying to build a simple > Projects / Tags app where Projects and Tags are associated as > has_and_belongs_to_many to each other. It's basically a simple list of > projects that have tags associated, and those tags in