[Rails] redirect_to :back - Any way to go back two pages?

2012-01-22 Thread Don
I've run in to a strange situation where it would be great if there were a way to use " redirect_to :back " to skip back over the previous page and go to the previous, previous page ( :back X 2.) Any one have any ideas how to do this? I think I might end up trying to use the session some how,

[Rails] Installing Ruby/TroubleShoot

2012-01-22 Thread Mark F.
I am having trouble with the Ruby on Rails for a windows 7 PC. During the installation on Ruby it said missing file 'lib' Then every time I try to generate a scaffold or controller it says Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runt

[Rails] Re: problem opening https OpenSSL problem

2012-01-22 Thread Bala TS
require 'net/http' def http_connection @http_connection = Net::HTTP.start(host, port) @http_connection.post(uri_path, params) @http_connection.finish @http_connection = nil end I hope it is work Try this way Bye:) bdeveloper01 -- Posted via http://www.ruby-forum.com/. -- You recei

[Rails] session problem in ruby on rails

2012-01-22 Thread Bala TS
Hai! I have two controller. the one is first_controller and another one is second_controller. first_controller.rb def login . . if @user && @user.password == params[:user][:password] session[:user_id] = @user.id redirect_to :controller => "second_controller", :action => "index" end end s

[Rails] Re: Javascript & Ajax Organization

2012-01-22 Thread Mateusz W.
Well, ideally I would like to have the views and javascripts split. I don't want to embed any javascript within my view. Something like this: http://bitprison.net/rails3_dynamic_javascript This, however, will make each user have "their own" javascript, since it has to be dynamically generated.

Re: [Rails] Re: Create new Rails with mysql default on database.yml

2012-01-22 Thread Noel
In 3.2 you can define .railsrc with custom command line options that will always apply to rails new Sent from my iPhone On Jan 22, 2012, at 8:01 PM, Norm Scherer wrote: > On 01/22/2012 06:16 PM, Felipe Pieretti Umpierre wrote: >> >> Ok, but how I can make the mysql be default ? >> > To m

Re: [Rails] Re: Create new Rails with mysql default on database.yml

2012-01-22 Thread Norm Scherer
On 01/22/2012 06:16 PM, Felipe Pieretti Umpierre wrote: Ok, but how I can make the mysql be default ? To make mysql the default when you run rails new you would have to modify the rails code somewhere (If you cannot figure out where on your own you should not try to modify it). To change the

Re: [Rails] Re: Create new Rails with mysql default on database.yml

2012-01-22 Thread Hassan Schroeder
On Sun, Jan 22, 2012 at 5:16 PM, Felipe Pieretti Umpierre wrote: > Ok, but how I can make the mysql be default ? Uh, well -- the reason I suggested running that command is that the answer is in the output. :-) -- Hassan Schroeder hassan.schroe...@gmail.com http://about

[Rails] Re: Create new Rails with mysql default on database.yml

2012-01-22 Thread Felipe Pieretti Umpierre
Ok, but how I can make the mysql be default ? -- 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 gro

[Rails] Re: Zlib problem

2012-01-22 Thread raoul s.
i can not trash zlib.so can you help me -- 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, se

Re: [Rails] Re: Create new Rails with mysql default on database.yml

2012-01-22 Thread Hassan Schroeder
On Sun, Jan 22, 2012 at 2:41 PM, Felipe Pieretti Umpierre wrote: > felipe@Felipe:~/rails_projects$ rails new --help No need to post the results -- they're the same for everybody :-) -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder twitt

Re: [Rails] undefined method `gsub!' for 2012-01-22 17:00:00 -0500..2012-01-23 00:00:00 -0500:Chronic::Span

2012-01-22 Thread Tom Meinlschmidt
On Jan 22, 2012, at 23:36 , John Merlino wrote: > Hey all, > > I am getting this error: > > NoMethodError (undefined method `gsub!' for 2012-01-22 17:00:00 > -0500..2012-01-23 00:00:00 -0500:Chronic::Span): > > > in this code: > > date_range = Chronic.parse(the_date, :g

[Rails] Re: Create new Rails with mysql default on database.yml

2012-01-22 Thread Felipe Pieretti Umpierre
felipe@Felipe:~/rails_projects$ rails new --help Usage: rails new APP_PATH [options] Options: -r, [--ruby=PATH] # Path to the Ruby binary of your choice # Default: /home/felipe/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -b, [--builder=BUILDER]#

[Rails] undefined method `gsub!' for 2012-01-22 17:00:00 -0500..2012-01-23 00:00:00 -0500:Chronic::Span

2012-01-22 Thread John Merlino
Hey all, I am getting this error: NoMethodError (undefined method `gsub!' for 2012-01-22 17:00:00 -0500..2012-01-23 00:00:00 -0500:Chronic::Span): in this code: date_range = Chronic.parse(the_date, :guess => false) reports.sum_distance_by_date(date_range).ea

Re: [Rails] Create new Rails with mysql default on database.yml

2012-01-22 Thread Hassan Schroeder
On Sun, Jan 22, 2012 at 2:17 PM, Felipe Pieretti Umpierre wrote: > Hello, I'm trying to connect with a db in my app, but when I go on > config/database.yml the default db is sqlite3, how can I put the mysql > as default ? `rails new --help` -- Hassan Schroeder hassan.s

[Rails] Re: why doesn't an instance of Object get Class's new instance method?

2012-01-22 Thread John Merlino
thanks for responses On Jan 21, 4:24 pm, Peter Vandenabeele wrote: > On Sat, Jan 21, 2012 at 9:03 PM, John Merlino wrote: > > "Object is the root of Ruby's class hierarchy. Its methods are > > available to all classes unless explicitly overridden." > > > Wouldn't Class class be at the root of th

[Rails] Create new Rails with mysql default on database.yml

2012-01-22 Thread Felipe Pieretti Umpierre
Hello, I'm trying to connect with a db in my app, but when I go on config/database.yml the default db is sqlite3, how can I put the mysql as default ? # SQLite version 3.x # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' development: adapter: sql

[Rails] problem opening https OpenSSL problem

2012-01-22 Thread Michael Baldock
I'm having trouble using the open(url) method. This used to work fine, but I've recently updated gems, and it seems to have broken. Also, I've switched to running on ree-1.8.7 to try and mimic my heroku stack. Not sure if that might have something to do with it as well at the top of my class I re

Re: [Rails] Javascript & Ajax Organization

2012-01-22 Thread Bill Walton
Hi Mateusz, On Sun, Jan 22, 2012 at 11:29 AM, Mateusz W. wrote: ... > Now, if I add an Ajax layer over this, things seem to complicate quite a > bit. Say, if I want to perform some kind of request using jQuery, I need > to be able to know the appropriate path to perform this request on (ex, > use

[Rails] Re: Sending custom headers in Find method in ActiveResource:Base

2012-01-22 Thread Nadeem Qureshi
I'll try to rephrase: I'm trying to forward a cookie from the user-end to the API that receives the request from ActiveResource::Base.find What I want to be able to do in my Controller is this: User.find(1, :headers => { :cookies => session['user'] } And have this send the cookie from the user

Re: [Rails] Re: Sending custom headers in Find method in ActiveResource:Base

2012-01-22 Thread Michael Pavling
On 22 January 2012 16:59, Michael Pavling wrote: > What do you mean > by "custom headers" in a find? Headers have nothing to do with an AR > find. Of course... you pointed the ActiveResource, and I've assumed ActiveRecord. Sorry for that. But still, you're not really doing enough to answer your o

[Rails] Javascript & Ajax Organization

2012-01-22 Thread Mateusz W.
Hey guys, Before I start off, I'm a Rails newbie, so if there is an obvious solution to this problem, let me know! I have a simple, blog-like Rails project. In the routes, I have a users resource with a nested posts resource. Now, this is all fine and dandy if everything is generated with Ruby.

[Rails] Re: Using Mongoid with ActiveRecord

2012-01-22 Thread Neener54
You could just go into the model and change it's inheritance. I've never used mongoid but I think that push comes to shove, simply switching << [modeltype] wouldn't be too hard. I'll keep an eye open for you though and see if I can figure it out. On Jan 21, 7:41 pm, Mike Kim wrote: > I'm trying

Re: [Rails] Re: Sending custom headers in Find method in ActiveResource:Base

2012-01-22 Thread Hassan Schroeder
On Sun, Jan 22, 2012 at 8:10 AM, Nadeem J. Qureshi wrote: > No one knows? > > I've tried to monkey paths rails to do this, but didn't work. In four days you haven't yet read the ActiveResource documentation? Or just tried googling `ActiveResource headers` ?!? -- Hassan Schroeder --

Re: [Rails] Re: Sending custom headers in Find method in ActiveResource:Base

2012-01-22 Thread Michael Pavling
On 22 January 2012 16:10, Nadeem J. Qureshi wrote: > No one knows? I don't think anyone really knows what you're asking. What do you mean by "custom headers" in a find? Headers have nothing to do with an AR find. Are you talking about browser headers (I guess it's something to do with a browser,

[Rails] Re: Sending custom headers in Find method in ActiveResource:Base

2012-01-22 Thread Nadeem J. Qureshi
No one knows? I've tried to monkey paths rails to do this, but didn't work. Please help :-) -- 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-talk/-/_hR

Re: [Rails] Problem when following http://guides.rubyonrails.org/getting_started.html

2012-01-22 Thread Javier Quarite
On Fri, Jan 20, 2012 at 9:05 PM, Peng Yu wrote: > Hi, > > I'm following instructions at > http://guides.rubyonrails.org/getting_started.html > > But I get the following error when I try "rake db:migrate". Does > anybody know what is wrong in my system? > > ~/RoR_src/blog$ rake db:migrate --trace

[Rails] Problem when following http://guides.rubyonrails.org/getting_started.html

2012-01-22 Thread Peng Yu
Hi, I'm following instructions at http://guides.rubyonrails.org/getting_started.html But I get the following error when I try "rake db:migrate". Does anybody know what is wrong in my system? ~/RoR_src/blog$ rake db:migrate --trace (in /Users/pengy/RoR_src/blog) rake aborted! uninitialized consta

Re: [Rails] Any help with refactory this ugly code?

2012-01-22 Thread regedarek
Thanks a lot, this my amendments. https://gist.github.com/1643261 -- 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-talk/-/9nw3zUSoK50J. To post to this g

[Rails] Re: Istalling Ruby 1.9.2

2012-01-22 Thread Neener54
I generally like to use rvm use 1.9.2 --default to make sure that I always use my preferred installation version. On Jan 19, 8:27 pm, Francesca Krihely wrote: > doh! For anyone who is silly like me, > After install put > rvm use 1.9.2 > > in the command line > > and voilla > > ruby 1.9.2p290 (201

[Rails] Re: Rails 3.1 compress assets production fails when compress is set to true

2012-01-22 Thread Neener54
Also keep in mind that you'll need to make sure the debug option is off otherwise it will force it to render individual assets. On Jan 17, 8:30 am, johnnybutler7 wrote: > Hi, > > I can deploy to staging fine. > > When i try and deploy to production i get the following error below, > it gets so fa

[Rails] aanyone help me for pdf formate

2012-01-22 Thread sudhir singh tomar
i installed the prown gem for getting my data in pdf formate but i getting error undefined method `to_sym' for PDF:Module i used this def show @student = Student.find(params[:id]) respond_to do |format| format.html format.json { render :json => @student } format.pdf { r

[Rails] Refactor two similar actions

2012-01-22 Thread Darek Finster
This code works but looks ugly. How to merge this two actions? #verifications/index.haml - if Ad.unverified_ads.size == 0 - else = link_to "Szybka Weryfikacja", fast_verify_info_verification_path(Ad.unverified_ads.last), :method => :put = link_to "Normal Verify", verify_info_verification_path(ad

[Rails] What's a good site for rails jobs worldwide?

2012-01-22 Thread Alexander Farennikov
Hello, I am wondering if there's a good web site where people from across the globe post RoR job openings and search for jobs. If there's not one such place, I'd appreciate if you could recommend such job boards in Eastern Europe, South America and / or India. Thanks! -- You received this message

[Rails] Issue with Rails application on SSL

2012-01-22 Thread RoR-Developer
Hi, I am facing an abnormal issue with my Ruby on Rails application. The application is running with apache, with fcgi module. When I turned on SSL connection on apache, the application kind of started working strangely. Seems like when SSL encryption is on, rails action is executed thrice (3

Re: [Rails] How to encode (.) Dot in url Rails

2012-01-22 Thread Loganathan Sellapa
I solved the problem by adding *ActionController::Routing::SEPARATORS = %w( / ; , ? ) *in my* routes.rb* file, but an warning message is displaying as below config/routes.rb:12: warning: already initialized constant SEPARATORS Want to know whether this warning will be an issue on future? regard