Re: [Rails] what's wrong?

2012-02-13 Thread Mauro
On 13 February 2012 03:11, Everaldo Gomes everaldo.go...@gmail.com wrote: because I didn't understand very well what are you doing. I'm trying to do: in route.rb I have: match /:layout = companies#index Then when I call localhost/intraOp ther params[:layout] is intraOp, when I call

[Rails] Working with rails console

2012-02-13 Thread Nitin A.
I am using rvm on the ubuntu. I am following the rails tutorial from Lynda.com I was on the section of working in the rails console when i got the following errors :- I gave the command rails console nitin@nitin-vaio:~/Nitin/Sites/app$ rails console Loading development environment (Rails

Re: [Rails] Working with rails console

2012-02-13 Thread Peter Vandenabeele
On Mon, Feb 13, 2012 at 9:43 AM, Nitin A. li...@ruby-forum.com wrote: I am using rvm on the ubuntu. I am following the rails tutorial from Lynda.com I was on the section of working in the rails console when i got the following errors :- I gave the command rails console

[Rails] Re: Rails with Ajax

2012-02-13 Thread Naira Kobo
Linus Pettersson wrote in post #1045014: Well, the code in the search view is executed when the view is rendered. It is not executed again when you inject the html using javascript. So the if @group_trace code is only executed when the search view is rendered and @group_trace is not created

[Rails] dj and god memory leak in rails application

2012-02-13 Thread Lucky Dev
We have delayed_job to handle background processing in our app. God monitors the more-memory-consuming DJ workers now and then and cut them off. This setup has been working perfectly for months with daily deploys. Now today, suddenly all the workers once they are started consumes 400+ MB memory

[Rails] Re: using jQuery with Rails 3.2

2012-02-13 Thread Dev Guy
On Mon, Feb 13, 2012 at 2:01 AM, Dev Guy devguy...@gmail.com wrote: Hi I am learning to use jQuery but I can't seem to get the following line to work from my html.erb file script type=text/javascript document.write(pHello from javascript!/p) $(pHello from jQuery!/p) /script /p I see the

Re: [Rails] Re: Create a new hash from an existing table

2012-02-13 Thread Colin Law
On 13 February 2012 07:00, edward michaels micah...@gmail.com wrote: Thanks, your idea did help. if I do: date = some_date reduce = Time.where(:date = date) I think you might run into trouble using a class Time as this is already a ruby class. Colin -- You received this message because

Re: [Rails] Project

2012-02-13 Thread Colin Law
On 13 February 2012 07:08, Anurag Sachan anuragsacha...@gmail.com wrote: I am creating application which requires User management of various levels for authorization of different level of users. I want several models: Admin_user Project Manager Company Clients Account : have many users of

Re: [Rails] what's wrong?

2012-02-13 Thread Colin Law
On 12 February 2012 22:51, Mauro mrsan...@gmail.com wrote: @current_layout is nil but authenticate_user! in companies_controller is skipped despite :unless = lambda {@current_layout.nil?} Perhaps skip_filter does not accept conditionals unless or if? I think you are right, I don't see it in

[Rails] Re: Problems with pg 0.13.0 gem

2012-02-13 Thread kennyj
Hi! Johann Aman I can reproduce this issue. Do you confirm the following commit ? https://github.com/kennyj/rails/commit/b40b7f459e3ea66f824ac4791d8882775b4f6717 On 2月11日, 午後10:09, Johann Aman johann.a...@gmail.com wrote: after updating pg gem to 0.13.0 got following error on production

[Rails] Rails devise with recaptcha

2012-02-13 Thread Ray Bovet
I'm trying to use the recaptcha gem with devise 2.0.0 in rails 3.2.1. Every time I try, I am able to display the captcha and input the 2 words it asks about. But in my controller (using code I found on github for the recaptcha gem, and after I replaced render_with_context with just plain render)

[Rails] Re: Rails devise with recaptcha

2012-02-13 Thread Ray Bovet
I did a little research inside the recaptcha gem code and discovered that recaptcha-not-reachable means that the code timed out before it got a response from the recaptcha website. Turns out the default timeout value is set at only 3 seconds. I was able to resolve the problem by changing the

[Rails] Implementing a history feature for a basic wiki app maybe papertrails ?

2012-02-13 Thread Sj
I have been trying a lot for the last two days to implement a history feature for my basic wiki rails app. I am using papertrails for that. But according to my below code, whenever i click undo. it reverts back to the first edit instead of the last edit. does that means its not storing the last

[Rails] rails validates format with

2012-02-13 Thread Venkat Surabhi
I want to dynamically validate my password with validates_format_of . validates_format_of :password,:with = need to get regular expression dynamically based up on the object setting. class Admin AR::Base validates_format_of :password,:with = lambda {|admin| admin.get_regular_exp} def

[Rails] Subdomain Redirect error

2012-02-13 Thread Kausik Bakshi
Hi I got error while I try this: My controller is : class SessionsController Devise::SessionsController def new super end def create resource = warden.authenticate!(:scope = resource_name, :recall = :failure) if resource subdomain_name =

[Rails] How to develope a standalone application in Rails

2012-02-13 Thread Hans
I have developed a rails 3.1 application with mysql, accessable by internet However, I also need a version of the same application used standalone on the users PC or MAC, i.e a form of an off-line mode, for those users that demand full controle of their data Can that be done ? My requiremets are

[Rails] Need to get the environment name

2012-02-13 Thread Rafi A
Hi All, I want to get the environment name in which the application is executing whether in production or in development etc using the bash script and want to write that result into the .sh file. Not by using the ruby. Any ideas of how to get this work? -- Cheers, Rafi *In Every moment, thank

Re: [Rails] Need to get the environment name

2012-02-13 Thread Peter Vandenabeele
On Mon, Feb 13, 2012 at 1:39 PM, Rafi A rafigl...@gmail.com wrote: Hi All, I want to get the environment name in which the application is executing whether in production or in development etc using the bash script and want to write that result into the .sh file. Not by using the ruby. Any

Re: [Rails] Need to get the environment name

2012-02-13 Thread Colin Law
On 13 February 2012 12:39, Rafi A rafigl...@gmail.com wrote: Hi All, I want to get the environment name in which the application is executing whether in production or in development etc using the bash script and want to write that result into the .sh file. Not by using the ruby. Any ideas of

Re: [Rails] Need to get the environment name

2012-02-13 Thread Max Schubert
You could use the rails runner and do something like # add rails bin dir to path first! RAILS_ENV=`rails runner puts Rails.env` That said, if this is something you need access to regularly, add initializer code to your app to write the end out to a well know file name under the project that

[Rails] Re: Problems with pg 0.13.0 gem

2012-02-13 Thread kennyj
Dear, Johann Aman pg gem 0.13.1 was released. And, the bahavior was changed. You can use it ! Please see also https://github.com/rails/rails/pull/5002 . On 2月12日, 午前1:09, kennyj ken...@gmail.com wrote: Hi! Johann Aman I can reproduce this issue. Do you confirm the following commit

[Rails] Script/server gives the error

2012-02-13 Thread Amrit Pal Pathak
script/server gives the following error. = Booting WEBrick = Rails 2.3.8 application starting on http://0.0.0.0:3000 /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant User::Authentication (NameError) from

Re: [Rails] Script/server gives the error

2012-02-13 Thread Colin Law
On 13 February 2012 13:58, Amrit Pal Pathak amritpalpath...@gmail.com wrote: script/server gives the following error. = Booting WEBrick = Rails 2.3.8 application starting on http://0.0.0.0:3000 /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:105:in

[Rails] STI vs Delegation

2012-02-13 Thread Darek F.
Hi, This is my recent project where is started to use STI for extend my Ad model. I never before used STI and many people which i recently discuss not recommended me to use this method. 1. What are the advantages and disadvanteges of STI and why i should use delegation ?? 2. And how in

Re: [Rails] Script/server gives the error

2012-02-13 Thread Amrit Pal Pathak
On Mon, Feb 13, 2012 at 7:42 PM, Colin Law clan...@googlemail.com wrote: On 13 February 2012 13:58, Amrit Pal Pathak amritpalpath...@gmail.com wrote: script/server gives the following error. = Booting WEBrick = Rails 2.3.8 application starting on http://0.0.0.0:3000

Re: [Rails] Script/server gives the error

2012-02-13 Thread Colin Law
On 13 February 2012 14:28, Amrit Pal Pathak amritpalpath...@gmail.com wrote: On Mon, Feb 13, 2012 at 7:42 PM, Colin Law clan...@googlemail.com wrote: On 13 February 2012 13:58, Amrit Pal Pathak amritpalpath...@gmail.com wrote: script/server gives the following error. = Booting WEBrick =

[Rails] Facing error while running rails2 project

2012-02-13 Thread aditya dsouza
Hi I am working with the following code , but getting an error ruby script/server = Booting WEBrick = Rails 2.3.5 application starting on http://0.0.0.0:3000 /usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is

Re: [Rails] Facing error while running rails2 project

2012-02-13 Thread Colin Law
On 13 February 2012 15:04, aditya dsouza li...@ruby-forum.com wrote: Hi I am working with the following code , but getting an error ruby script/server = Booting WEBrick = Rails 2.3.5 application starting on http://0.0.0.0:3000

[Rails] Re: Facing error while running rails2 project

2012-02-13 Thread aditya dsouza
Hi Colin, Thanks for replying. I checked the line number you said to and it contains something like this. CACHE = Earth::Db::Base.cache_manager = Earth::Db::MemcacheManager.new('localhost:11211') I did install the memcache gem. Any ideas how to solve this as I am a newbie in Rails. Colin Law

Re: [Rails] Script/server gives the error

2012-02-13 Thread Peter De Berdt
On 13 Feb 2012, at 15:35, Colin Law wrote: = Booting WEBrick = Rails 2.3.8 application starting on http://0.0.0.0:3000 /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/ active_support/dependencies.rb:105:in `const_missing': uninitialized constant User::Authentication (NameError)

Re: [Rails] Re: Facing error while running rails2 project

2012-02-13 Thread Colin Law
On 13 February 2012 15:31, aditya dsouza li...@ruby-forum.com wrote: Could you not top post please, it makes it difficult to follow the thread. Insert your reply at appropriate points in the previous message, thanks. Hi Colin, Thanks for replying. I checked the line number you said to and it

Re: [Rails] How to develope a standalone application in Rails

2012-02-13 Thread Norm Scherer
On 02/13/2012 05:39 AM, Hans wrote: I have developed a rails 3.1 application with mysql, accessable by internet However, I also need a version of the same application used standalone on the users PC or MAC, i.e a form of an off-line mode, for those users that demand full controle of their data

Re: [Rails] How to develope a standalone application in Rails

2012-02-13 Thread Walter Lee Davis
On Feb 13, 2012, at 11:05 AM, Norm Scherer wrote: On 02/13/2012 05:39 AM, Hans wrote: I have developed a rails 3.1 application with mysql, accessable by internet However, I also need a version of the same application used standalone on the users PC or MAC, i.e a form of an off-line mode,

[Rails] Re: Rails with Ajax

2012-02-13 Thread Linus Pettersson
Yes, but the code in the search view is not executed again when the AJAX request is fired :) So, you have to do the check in your loader.js.erb and not the search view. Something like this should work: % if @group_trace % $('#loader_div').html(%=j render(@group_trace)%); % end % Cheers! --

[Rails] Ajax rendering partial ( fields in form)

2012-02-13 Thread Erwin
when rendering a piece of my form after an Ajax call, I get the error ActionView::Template::Error (undefined local variable or method `f' for ##Class: controller def change_price new_price = @tax_amount = new_price * I18n.t(:standard_tax_rate) render

[Rails] Delete :confirm = Sure?

2012-02-13 Thread Christopher Jones
Hey all, well I have a delete function in my rails application that works successfully. When I click the button it deletes the record from the page as well as the database, my problem is that I don't want it to instantaneously do this, I want it to give the user the option to cancel before hand.

[Rails] Experiences using Database.com with Ruby on Rails

2012-02-13 Thread Andrew
Hello, My boss is really pushing us to switch to using Database.com for our database. He seems to think it's the solution to every problem we've never had. I've never worked with it before, so I don't know how it compares to using plain, old, ActiveRecord. I'm hoping to get some candid

[Rails] rails_panel - new admin interface for Rails

2012-02-13 Thread slawosz
Hi, from few weeks I started to develop rails_panel: https://github.com/slawosz/rails_panel - readme describes how to start. It is early stage development now, but I would like to get some feedback, or (it would be so great!) contributors. Please look at the project and try to play with one of

Re: [Rails] Experiences using Database.com with Ruby on Rails

2012-02-13 Thread Noel
On Mon, Feb 13, 2012 at 9:47 AM, Andrew misbehav...@gmail.com wrote: Hello, My boss is really pushing us to switch to using Database.com for our database. He seems to think it's the solution to every problem we've never had. I've never worked with it before, so I don't know how it compares to

Re: [Rails] Experiences using Database.com with Ruby on Rails

2012-02-13 Thread Kevin Bedell
If you're boss can't articulate the benefits to you for why he (or she) wants you to do this -- and they're pushing you to undertake a technical solution that could make you're development more complex without understanding the impact of it - then they are an idiot. Please feel free to tell them I

[Rails] Re: Encoding error

2012-02-13 Thread Felipe Pieretti Umpierre
I resolved this problem, after re install my ubuntu, and start another project, I got the same error, so I put mysql2 as adapter and restart my server. Thank you. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] What I'm doing wrong, has_and_belong_to_many

2012-02-13 Thread Felipe Pieretti Umpierre
Hello, I'm trying to insert into my migrate but when I try on rails console this error shows: 1.9.3-p0 :001 group = Group.new = #Group id: nil, name: nil, description: nil, created_at: nil, updated_at: nil 1.9.3-p0 :002 group.name = Group Name = Group Name 1.9.3-p0 :003 group.description =

Re: [Rails] What I'm doing wrong, has_and_belong_to_many

2012-02-13 Thread Dave Aronson
On Mon, Feb 13, 2012 at 20:43, Felipe Pieretti Umpierre li...@ruby-forum.com wrote: Hello, I'm trying to insert into my migrate but when I try on rails console this error shows: ... 1.9.3-p0 :009 group email NoMethodError: undefined method `' for #Group:0xa7efb80 This is the chunk you need

Re: [Rails] Delete :confirm = Sure?

2012-02-13 Thread Ahmy Yulrizka
Mine work fine here, what rails version did you use. Im using 3.2 here, make sure that the page include: script src=/assets/jquery_ujs.js?body=1http://localhost:3000/assets/jquery_ujs.js?body=1 type=text/javascript/script or something similar. Ahmy Yulrizka On Tue, Feb 14, 2012 at 12:28 AM,

[Rails] best approach for ocean ship tracking or similar

2012-02-13 Thread Jedrin
Say you have a web page that is supposed to continuously update the positions of ships in the ocean or something similar. I am wondering what is a good approach for this ? The page updates automatically without the user hitting any buttons or clicking on anything. What occurs to me is a timer

Re: [Rails] Project

2012-02-13 Thread Siva Prasad
CanCan would be simple to achieve what you want.Install cancan gem and define Ability.rb in models Sample Abillity.rb might look like this. class Ability include CanCan::Ability def initialize(user) # Define abilities for the passed in user here. For example: # user ||=