[Rails] Using Rails Objects in js file

2010-10-27 Thread bertly_the_coder
Hey guys, This seems pretty simple, but I cannot seem to find an answer online. I have a user model and would like to use a user object in the js file. Any ideas as to how I can do this? Thanks and Regards. -- You received this message because you are subscribed to the Google Groups "Ruby on R

[Rails] Re: Using ActiveRecord 3.0.x with Ruby 1.9.2

2010-10-27 Thread dwormuth
I tried this too, but when I put it in an .rb file, I get the error above. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email

[Rails] validation on subdomain unique

2010-10-27 Thread AppleII717
Using Devise on an application with basecamp like subdomains. You can only register(sign_up) if the account(subdomain) you are creating is unique. You can only register(sign_up) from the root domain. account_name is attr_accessor :account_name in user record and is created when the user is creat

[Rails] trouble testing callbacks on update to model with nested attributes

2010-10-27 Thread Lille
Hi, I have a parent model like this: class Parent < ActiveRecord::Base belongs_to :grand_parent has_many :blond_children, :dependent => :destroy has_many :brunette_children, :dependent => :destroy has_many :dogs, :dependent => :destroy accepts_nested_attributes_for :blond_children, :br

Re: [Rails] connecting to exchange server

2010-10-27 Thread radhames brito
I don't think the issue is specifically postfix. On a couple of different servers, I have gotten Exchange to act as if it was a mail server by adding an MX record for the Web server, set to such a low priority that it won't ever see the light of incoming mail. In one other case, the Exchange admin

Re: [Rails] PostgreSql SELECT DISTINCT and ORDER BY returns an error

2010-10-27 Thread Philip Hallstrom
On Oct 27, 2010, at 2:48 PM, Gabi Ge wrote: > Hello, > > Given: > > - a Dealer model and controller > - index page with a search form on top and results shown below > > Problem: > > I'd like to select dealers based on keyword, status and program then > order them by name/launched_at asc/desc.

[Rails] Anything special needed to migrate test::unit tests from Rails 2x to Rails3?

2010-10-27 Thread David Kahn
Looks like I've gotten my app upgraded successfully, at least in the browser. When I 'rake test' I get no love. I know I can start digging through the Rails rake tasks, first want to see if anyone has an idea what is going on: DKMac:creditcompare3 DK$ rake test (in /Users/DK/Documents/ror/projects

[Rails] Re: Problems with the views.

2010-10-27 Thread Blue Skull
Greetings, dear, thanks for answering, my versions. C:\>ruby -v ruby 1.9.2p0 (2010-08-18) [i386-mingw32] C:\>gem -v 1.3.7 C:\>rails -v Rails 3.0.0 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gro

Re: [Rails] Problems with the views.

2010-10-27 Thread Rodolinux
Wich version of Ruby and Rails do u use now? On Thu, Oct 28, 2010 at 12:15 AM, Blue Skull wrote: > Greetings, I have an app running on RoR, this app is of ultra-basic > style (http://www.hackerdude.com/courses/rails/PrimeraAplicacion.html), > this app works as it in the example, but I can not ru

Re: [Rails] connecting to exchange server

2010-10-27 Thread Walter Lee Davis
On Oct 27, 2010, at 6:10 PM, radhames brito wrote: I have a public website accessible from the intranet and i have to send mail to the inside and outside but the thing is when i try to send mails with postfix apparently the exchange server wont accept those so i cant send mails to the inside, n

[Rails] Problems with the views.

2010-10-27 Thread Blue Skull
Greetings, I have an app running on RoR, this app is of ultra-basic style (http://www.hackerdude.com/courses/rails/PrimeraAplicacion.html), this app works as it in the example, but I can not run the views, in the folder \views, I have \layout and \Main, with their corresponding files (.html.erb).

[Rails] connecting to exchange server

2010-10-27 Thread radhames brito
I have a public website accessible from the intranet and i have to send mail to the inside and outside but the thing is when i try to send mails with postfix apparently the exchange server wont accept those so i cant send mails to the inside, now im trying to send with the exchange server but i can

[Rails] PostgreSql SELECT DISTINCT and ORDER BY returns an error

2010-10-27 Thread Gabi Ge
Hello, Given: - a Dealer model and controller - index page with a search form on top and results shown below Problem: I'd like to select dealers based on keyword, status and program then order them by name/launched_at asc/desc. The query joins in other tables that are needed to perform the 'by

[Rails] Re: Does Ruby 1.9.2 include ftools? SOLVED

2010-10-27 Thread structuralartistry
Just found: ftools is depricated and changed to fileutils. On Oct 27, 4:28 pm, David Kahn wrote: > If I run irb, and do this: > > require 'ftools' > > The response is: > > LoadError: no such file to load -- ftools > > I see around that 1.9.1 did not include ftools but no mention of 1.9.2. > Looki

[Rails] Does Ruby 1.9.2 include ftools?

2010-10-27 Thread David Kahn
If I run irb, and do this: require 'ftools' The response is: LoadError: no such file to load -- ftools I see around that 1.9.1 did not include ftools but no mention of 1.9.2. Looking at the Ruby docs (http://www.ruby-doc.org/stdlib/), ftools is still there. Any ideas? Thanks, David -- You r

[Rails] Re: Create super-simple adding application

2010-10-27 Thread debalmoto
Thank you guys so much for your help. I think I have everything working now. It must be frustrating dealing with such simple issues. Just one more question: Did you intend to put the " - " in <%= form_tag('/') do -%> ? I removed it and it didn't seem to change anything. Thanks again for the hel

Re: [Rails] Re: Update password with Devise

2010-10-27 Thread Walter Lee Davis
Try typing rake routes in your project folder (in Terminal). You should see all the various routes explained for you. Depending on the combination of modules you have enabled in Devise, this route users/ password/edit may mean something specific. See which controller and which action it is h

[Rails] Re: Update password with Devise

2010-10-27 Thread Leonel *.*
This is the page http://localhost:3000/users/password/edit When I'm NOT logged in I can see it, but when IM LOGGED in it redirects me. weird -- 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

[Rails] Re: Update password with Devise

2010-10-27 Thread Leonel *.*
I just found a page that is already built on Devise but it redirects me to the root when I try to access it. Is there a reason for this? The user that is trying to access that page has can :manage, :all -- Posted via http://www.ruby-forum.com/. -- You received this message because you are sub

[Rails] Action Caching with memcached with config.cache_classes = true in development.rb/production.rb not working in Rails 2.1

2010-10-27 Thread Ankit
When I put config.cache_classes = true in development.rb/ production.rb, index action is not cached in memcache stor, rather local cache store is used. On putting config.cache_classes = false , action caching is working fine. In production we want config.cache_classes = true, but then caching is no

[Rails] [Startup] Java Backend and Rails Frontend

2010-10-27 Thread Ian
I have a startup considering building a Java backend and a Rails frontend. The Java backend will take care of creating a caching layer for the database and offer other additional services. The Rails frontend will mostly be for creating the webapp and monitoring tools. What startups/companies out t

[Rails] "Missing partial layouts/application" error on render :partial => "index", :layout => "application" - Rails3

2010-10-27 Thread David Kahn
This is the second time I have seen this error, and been googling around and cant find an explanation. This error is happening with Rails 3/1.9.2 and was not with Rails 2.3.8/1.8.7: *Template is missing Missing partial layouts/application with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :f

[Rails] Update password with Devise

2010-10-27 Thread Leonel *.*
I've been googling a lot about it and can't find the solution. I have a form to edit a user, but I need to two fields to update or change their password: New Password / Confirm Password fiels. I know you can reset your password by clicking the Forgot My Password link. But I want them to be able t

[Rails] Re: passenger for both rails 2.3 and 3.0

2010-10-27 Thread Marnen Laibow-Koser
Sam Kong wrote in post #957571: > Hi, > > I installed ruby 1.8.7 and passenger 3.0 for apache2 on Ubuntu 10.10. > Rails 2.3 works fine. > But Rails 3.0 gives an error saying that rack version is not 1.2.1. > If I upgrade the rack to 1.2.1, then rails 2.3 app complains that the > rack version is not

[Rails] Re: Cygwin Rails issues "/dev/urandom" not found

2010-10-27 Thread Brian M.
The files in /dev don't exist by default under cygwin. Instead cygwin internally handles reading and writing to them specially. See http://www.cygwin.com/cygwin-ug-net/using-specialnames.html for more info. There is also a script to create the dev files. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Order by "title" but then put "Other" at the end?

2010-10-27 Thread Tim Shaffer
I solved this in an application by creating a separate "sort_name" field that was strictly used for sorting. Never seen or used by the user at all. We had a "before_save :build_sort_name" method that handled all sorts of cases. Wouldn't be too hard to add something similar for your scenario. def b

[Rails] Re: Can't use rails_upgrade plugin on Windows due to missing fork() function

2010-10-27 Thread Marc Bungart
Hi daze, I’m trying the same without a solution yet. Did you make any progress? Kind regards Marc -- 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 rubyonrai

[Rails] Help with routes

2010-10-27 Thread James Byrne
Switching our routes file from Rails2 to Rails3 DSl uncovered an odd situation, of my own making, but I am having some difficultly imagining how to fix it. Basically I have a commonplace: user -> user_role (clearance) <- role type arrangement where: User has_many :roles, :through => :clearance

[Rails] Re: passenger for both rails 2.3 and 3.0

2010-10-27 Thread Luis Saffie
hmmm... So you're using Rails 2.3 and 3.0 versions? Luis Saffie -- http://saffie.ca -- 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-t...@google

[Rails] passenger for both rails 2.3 and 3.0

2010-10-27 Thread Sam Kong
Hi, I installed ruby 1.8.7 and passenger 3.0 for apache2 on Ubuntu 10.10. Rails 2.3 works fine. But Rails 3.0 gives an error saying that rack version is not 1.2.1. If I upgrade the rack to 1.2.1, then rails 2.3 app complains that the rack version is not ~>1.1.0. How do I satisfy both rails 2.3 an

[Rails] Re: Virtual model

2010-10-27 Thread Marnen Laibow-Koser
Satsou Sa wrote in post #957508: > yong gu wrote in post #957495: >> If you are using rails 3, see this >> http://railscasts.com/episodes/219-active-model > > Thanks! But there is a problem with ActiveModel: I can not make > associations such as belongs_to or has_many... Why do you need them on a

[Rails] Re: Order by "title" but then put "Other" at the end?

2010-10-27 Thread Marnen Laibow-Koser
E. Litwin wrote in post #957563: > On Oct 27, 9:09am, Marnen Laibow-Koser wrote: >> The easiest way would involve using a separate DB field, so that you can >> do ORDER BY title, put_at_end. > > Wouldn't that have to be ORDER BY put_at_end, title? (assuming > put_at_end has a value of 0 or 1) Yes

[Rails] Re: Order by "title" but then put "Other" at the end?

2010-10-27 Thread E. Litwin
On Oct 27, 9:09 am, Marnen Laibow-Koser wrote: > The easiest way would involve using a separate DB field, so that you can > do ORDER BY title, put_at_end. Wouldn't that have to be ORDER BY put_at_end, title? (assuming put_at_end has a value of 0 or 1) -- You received this message because you ar

[Rails] Re: Inflect word depending on number

2010-10-27 Thread Tim Shaffer
On Oct 27, 10:40 am, Marnen Laibow-Koser wrote: > Rob Biedenharn wrote in post #957481:> On Oct 27, 2010, at 8:35 AM, Vitaliy > Yanchuk wrote: > > >> How can I use proper word after number, depending on that number. > >> For example I have message that says: > > >> for 23 monthes, or it can be 21

[Rails] Re: rails version check for gems

2010-10-27 Thread Tony Primerano
yeah that works better. :-) How other gems are handling this. It looks like acts_as_ferret is only supporting Rails3 in > 0.5 so no need for version checks there (unfortunately it isn't quite rails 3 ready yet). On Oct 27, 9:41 am, Tim Shaffer wrote: > On Oct 27, 9:09 am, Tony Primerano wro

[Rails] Re: Virtual model

2010-10-27 Thread Satsou Sa
yong gu wrote in post #957495: > If you are using rails 3, see this > http://railscasts.com/episodes/219-active-model Thanks! But there is a problem with ActiveModel: I can not make associations such as belongs_to or has_many... -- Posted via http://www.ruby-forum.com/. -- You received this m

[Rails] Re: Inflect word depending on number

2010-10-27 Thread Marnen Laibow-Koser
Rob Biedenharn wrote in post #957481: > On Oct 27, 2010, at 8:35 AM, Vitaliy Yanchuk wrote: > >> How can I use proper word after number, depending on that number. >> For example I have message that says: >> >> for 23 monthes, or it can be 21 month. >> So I have to inflect depending on number >> >>

[Rails] RubyZip Exceptions

2010-10-27 Thread Pete
Hi, I am wondering if there is a way of catching exceptions that are thrown within rubyzip.rb. For example: in rubyzip line 583, private def set_time(binaryDosDate, binaryDosTime) @time = Time.parse_binary_dos_format(binaryDosDate, binaryDosTime) rescue ArgumentError puts "I

Re: [Rails] Virtual model

2010-10-27 Thread yong gu
If you are using rails 3, see this http://railscasts.com/episodes/219-active-model On Wed, Oct 27, 2010 at 4:06 PM, Satsou Sa wrote: > Hello, > > I would like to create a simple ActiveRecord model, but working without > table... Is that possible? I think we can this a virtual model. > > And I wo

Re: [Rails] Facebook API

2010-10-27 Thread yong gu
You could try http://facebooker.rubyforge.org/ On Wed, Oct 27, 2010 at 9:05 PM, jef wrote: > Hi, > > What is the best library to develop a facebook app? > > Thanks > JF > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to

[Rails] Re: rails version check for gems

2010-10-27 Thread Tim Shaffer
On Oct 27, 9:09 am, Tony Primerano wrote: > Seems like that would break something once Rails 4 comes out.  ;-) Couldn't you do this? if Rails::VERSION::STRING.to_i >= 3 puts "at least rails 3" else puts "rails 2 or lower" end -- You received this message because you are subscribed to the G

Re: [Rails] Inflect word depending on number

2010-10-27 Thread Rob Biedenharn
On Oct 27, 2010, at 9:19 AM, Michael Pavling wrote: On 27 October 2010 14:07, Rob Biedenharn wrote: If you're just in plain Ruby, it might depend on the pluralization rule: "#{n} month#{'s' unless n == 1}" "#{n} part#{n == 1 ? 'y' : 'ies'}" "#{n} fish" You can also use String.plu

Re: [Rails] SOAP::RPC::Driver

2010-10-27 Thread Michael Pavling
On 27 October 2010 14:23, Rose Rose wrote: > i want to get a service from this site : > > http://ww2.tsetmc.com/webservice/TsePublic.asmx > > but this site return a empty object for this method > => SOAP::Mapping::Object Have you tested that the service works nicely with your request from a mocki

[Rails] SOAP::RPC::Driver

2010-10-27 Thread Rose Rose
i want to get a service from this site : http://ww2.tsetmc.com/webservice/TsePublic.asmx def index soapdriver = SOAP::WSDLDriverFactory.new(wsdlPath).create_rpc_driver result = soapdriver.Board(:UserName => 'usernameValue',:Password => 'passwordValue') end but this site return a emp

Re: [Rails] Inflect word depending on number

2010-10-27 Thread Michael Pavling
On 27 October 2010 14:07, Rob Biedenharn wrote: > > If you're just in plain Ruby, it might depend on the pluralization rule: > >  "#{n} month#{'s' unless n == 1}" > >  "#{n} part#{n == 1 ? 'y' : 'ies'}" > >  "#{n} fish" > You can also use String.pluralize "#{n} {n == 1 ? 'month' : 'month'.plurali

[Rails] rails version check for gems

2010-10-27 Thread Tony Primerano
I'm seeing a handful of gem bugs on rails3 that are going unresolved because the fix breaks the gem on rails2. What is the preferred way to add rails version conditions to a gem? Is checking the Rails::VERSION::STRING what folks should be doing? if Rails::VERSION::STRING.start_with?("3") do rai

Re: [Rails] Inflect word depending on number

2010-10-27 Thread Rob Biedenharn
On Oct 27, 2010, at 8:35 AM, Vitaliy Yanchuk wrote: How can I use proper word after number, depending on that number. For example I have message that says: for 23 monthes, or it can be 21 month. So I have to inflect depending on number -- If you're in a Rails view, you can say: pluraliz

[Rails] Facebook API

2010-10-27 Thread jef
Hi, What is the best library to develop a facebook app? Thanks JF -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rub

[Rails] Inflect word depending on number

2010-10-27 Thread Vitaliy Yanchuk
How can I use proper word after number, depending on that number. For example I have message that says: for 23 monthes, or it can be 21 month. So I have to inflect depending on number -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Googl

[Rails] Re: Empty array check

2010-10-27 Thread Pale Horse
Michael Pavling wrote in post #957448: > On 27 October 2010 11:43, Pale Horse wrote: > >> Which of the two methods below are the most stable? Does it matter? >> >> !...@articles.empty? >> @articles.length > 0 >> >> I personally prefer using the 'empty?' method. > > Between the two, I'd use ".empty

[Rails] Re: JRuby + Windows Service

2010-10-27 Thread pepe
I use Mongrel as web service. Here is a link that might help: http://noobonrails.blogspot.com/2006/06/how-to-setup-mongrel-as-native-windows.html On Oct 26, 10:29 am, Daniel Shimoyama wrote: > Wassup everyone? > > I'm trying to deploy a application on windows server 2000, developed > with JRuby.

[Rails] Re: Problems when connecting to Sql server 2008 odbc no such file to load error

2010-10-27 Thread Fredrik TiC Jansson
i succeded in getting it working and posted a short how-to in this thread http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/90bac21d2f5d2616/908fbcaed47c5259#908fbcaed47c5259 will probably go the CentOS PhuzionPassenger MySql route in the future. On 26 Okt, 18:56, Marnen Laibo

[Rails] Using ActiveRecord 3.0.x with Ruby 1.9.2

2010-10-27 Thread dwormuth
Can someone remind me of the incantation to use ActiveRecord in a plain ruby program for the versions specified. I'm not having any luck searching with google and I keep getting: `require': no such file to load -- activerecord (LoadError) Not sure if this is a dependency or file path problem. T

Re: [Rails] Empty array check

2010-10-27 Thread Michael Pavling
On 27 October 2010 11:43, Pale Horse wrote: > Which of the two methods below are the most stable? Does it matter? > > !...@articles.empty? > @articles.length > 0 > > I personally prefer using the 'empty?' method. Between the two, I'd use ".empty?", but at a choice I'd use neither, and go for ".bl

[Rails] Empty array check

2010-10-27 Thread Pale Horse
Which of the two methods below are the most stable? Does it matter? !...@articles.empty? @articles.length > 0 I personally prefer using the 'empty?' method. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Google maps

2010-10-27 Thread Christian Fazzini
Anyone know an up-to-date gem for Rails 3 to connect and display markers on google maps? It seems the gem YM4R hasn't been updated for a while now... Most of the articles I find on Google are a bit outdated as well. Should I just stick with native Google Map API for this? -- You received this me

[Rails] Re: Form_for problem after upgrading

2010-10-27 Thread Ganesh Kathare
tashfeen.ekram wrote in post #957373: > I am upgrading to rails 3 and afer diong so, none of my form_for are > working. (I can not actually say not all of them are working but the > few that i have tried are not). The page loads fine but the form is > not output. This is after making the the change

[Rails] Re: Trubelshooting MS Sql database connection

2010-10-27 Thread Fredrik TiC Jansson
I finally got it working after a lot of googeling around big thanks to http://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Platform-Installation---Windows for pointing me towards ruby-odbc which was the final peice to solve my puzzle How to get Ruby on Rails working with MS SQL

[Rails] Virtual model

2010-10-27 Thread Satsou Sa
Hello, I would like to create a simple ActiveRecord model, but working without table... Is that possible? I think we can this a virtual model. And I would like to be able to use relations (like has_many :users, etc) with this model (named App for instance), such as: > App.first.users Thanks f

[Rails] Re: Trubelshooting MS Sql database connection

2010-10-27 Thread Fredrik TiC Jansson
I finally got it working after a lot of googeling around big thanks to http://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Platform-Installation---Windows for pointing me towards ruby-odbc which was the final peice to solve my puzzle How to get Ruby on Rails working with MS SQL

Re: [Rails] Rails 3 - Creating a JSON response to display Search Results

2010-10-27 Thread Peter De Berdt
On 27 Oct 2010, at 07:23, CuriousNewbie wrote: Hello, I'm working to have Rails 3 respond with a JSON request which will then let the app output the search results with the jQuery template plugin... For the plugin to work, it needs this type of structure: [ { title: "The Red Violin", u

Re: [Rails] Re: Re: Forcing rails to output HTML4 rather then XHTML?

2010-10-27 Thread Rimantas Liubertas
> What I'm trying to find out is specifically how IE 6 breaks (as in > incorrectly renders the page) when using valid HTML 5 markup (including > self-closing tags) with . Again assume no HTML 5 only > features only markup syntax. > > I'm asking because I don't personally use any version of IE, much

[Rails] Re: Form_for problem after upgrading

2010-10-27 Thread Solrac Caritas
> <%= form_for @user_session, :url => user_session_path do |f| %> > Email > <%= text_field_tag :login %> > Password > <%= f.password_field :password %> > Remember Me > <%= f.check_box :remember_me %> > <%= f.submit "Login" %> > <% end %> replace <%= text_field_tag :login %> with