[Rails] Re: Can't connect to localhost:3000

2014-10-15 Thread jsnark
On *nix systems, the file /etc/hosts contains the mapping from localhost to 127.0.0.1. It should contain a line like: 127.0.0.1 localhost.localdomain localhost I do not know whether or not Mac uses the same file. On Tuesday, October 14, 2014 10:05:13 PM UTC-4, mike...@comcast.net

[Rails] Re: [Feature idea] Truncating timestamp precision

2014-10-06 Thread jsnark
You can extend the class yourself: DateTime.class_eval do define_method(:truncate_precision) { |amount| puts amount } end => # DateTime.now.truncate_precision(sec: 10) {:sec=>10} => nil On Monday, October 6, 2014 8:17:58 AM UTC-4, powi wrote: > > Hello. > > I thought of adding a method i

[Rails] Re: cucumber tests failing - No route matches [GET] "/stylesheets

2014-04-02 Thread jsnark
Both problems solved. To solve the first problem, I trashed what I had done and started over. I do not know what went wrong the first time. The second problem was caused by pilot error. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

[Rails] Re: cucumber tests failing - No route matches [GET] "/stylesheets

2014-03-31 Thread jsnark
I've added another engine. Again it runs just fine as a stand alone application (test/dummy) and as an engine inside the main application, but this time when I use cucumber it mangles the route. The generated controller name is NamespaceController, instead of Namespace::Controller. The only s

[Rails] cucumber tests failing - No route matches [GET] "/stylesheets

2014-03-28 Thread jsnark
Please help. I am stumped. I have four engines inside a rails application. The cucumber scenarios run just fine in three of the engines. The fourth fails with the error: No route matches [GET] "/stylesheets/common_engine/application.css" (ActionController::RoutingError) /usr/local/ruby-1

[Rails] Re: Cucumber test question

2014-02-12 Thread jsnark
On Tuesday, February 11, 2014 3:43:40 PM UTC-5, Vell wrote: > > Hello all, > > I am trying to understand when I try to run a test in cucumber what I am > missing that it is failing. I am using FactoryGirl to create my records and > using cucumber to test my logic however I know that I am doing

Re: [Rails] Re: Help me connect to MySQL Database

2014-01-20 Thread jsnark
On Monday, January 20, 2014 9:23:10 AM UTC-5, Jordon Bedwell wrote: > > On Mon, Jan 20, 2014 at 8:10 AM, jsnark > > wrote: > > *.erb files do not connect to databases. Models do. Follow Colin's > advise > > and work through the tutorial. > > If *.er

[Rails] Re: Help me connect to MySQL Database

2014-01-20 Thread jsnark
*.erb files do not connect to databases. Models do. Follow Colin's advise and work through the tutorial. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email t

[Rails] Re: need help deploying rails engine

2014-01-15 Thread jsnark
Problem solved. The namespaced paths generated by engine.path need to be modified by prefixing them with the applications base path. I use the apache RewriteRule for this: RewriteRule ^/engine/?(.*) /app/engine/$1 [R] -- You received this message because you are subscribed to the Google Group

[Rails] need help deploying rails engine

2014-01-14 Thread jsnark
I'm having problems deploying a rails application that contains engines. When I had namespaced routes (Engine::Application.routes.draw) in routes.rb, I was unable to get past the "no such file or directory" errors from apache. The request never got back to the application. When I used global

[Rails] Re: rails3 cap deploy error

2014-01-14 Thread jsnark
Look at the file /apps/myapp_com/staging/shared/bundle/ruby/1.9.1/gems/nokogiri-1.6.1/ext/nokogiri/gem_make.out If you can not figure out what the problem is, post that file here. On Tuesday, January 14, 2014 7:45:25 AM UTC-5, der_tom wrote: > > * executing "cd /apps/myapp_com/staging/releases

[Rails] Re: rails engine - vendor/bundle and vendor/cache

2014-01-08 Thread jsnark
Found the solution. This explanation may not be 100% accurate. Bundle remembers how it was first executed in the directory '.bundle'. Subsequent executions use this information. 'bundle install' puts the gems in the vendor/bundle directory. 'bundle package' puts the gems in the vendor/cache

[Rails] rails engine - vendor/bundle and vendor/cache

2014-01-07 Thread jsnark
I created two rails engines. In one of them 'bundle install' generated only a vendor/cache directory. In the other one, 'bundle install' created both vendor/cache and vendor/bundle. The vendor/bundle directory is causing me some problems. I do not remember what I did differently when creati

[Rails] rails engines and models

2013-12-30 Thread jsnark
I have several rails applications that I want to combine into a single application using rails engines. Many of the models appear in multiple applications (now engines) and have some methods in common. I want to make this code DRY, removing the code duplication that I now have. Ideally, I wa

Re: [Rails] Re: Rails Engines problem: routing_error.erb within rescues/layout

2013-12-27 Thread jsnark
On Friday, December 27, 2013 11:13:03 AM UTC-5, Hassan Schroeder wrote: > > On Fri, Dec 27, 2013 at 7:41 AM, jsnark > > wrote: > > > Thanks. Upgrading to rails 3.2.12 did the trick. > > Uh, and you realize that 3.2.13, 3.2.15, and 3.2.16 (latest 3.2.x) all > i

[Rails] Re: Rails Engines problem: routing_error.erb within rescues/layout

2013-12-27 Thread jsnark
On Thursday, December 26, 2013 5:24:43 PM UTC-5, Frederick Cheung wrote: > > > > On Thursday, December 26, 2013 8:41:21 PM UTC, jsnark wrote: >> >> I'm working through the Rails Engines tutorial at >> http://edgeguides.rubyonrails.org/engines.html. I'm

[Rails] Re: Rails Engines problem: routing_error.erb within rescues/layout

2013-12-26 Thread jsnark
I forgot to add- Google did not help me. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this g

[Rails] Rails Engines problem: routing_error.erb within rescues/layout

2013-12-26 Thread jsnark
I'm working through the Rails Engines tutorial at http://edgeguides.rubyonrails.org/engines.html. I'm using ruby 1.9.3 and rails 3.1.12 on Linux. I'm stuck on section 4.1. When I try to access localhost:3000/blog I get: Started GET "/blog" for 127.0.0.1 at 2013-12-26 15:25:12 -0500 ActionCo

[Rails] Re: Email out of Rescue

2013-12-10 Thread jsnark
http://smartinez87.github.io/exception_notification/ should do what you want -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@

[Rails] Re: Two fields in model but only need to store last field selected by user

2013-10-04 Thread jsnark
I would use javascript and jquery to keep track of the user's last selection. Then, also with javascript, intercept the submit and using ajax send the request containing only the last selection. On Friday, October 4, 2013 5:54:43 AM UTC-4, Ruby-Forum.com User wrote: > > Hi, > > > Please help m

[Rails] Re: redirect on browser success, but redirect on functional test is error

2013-09-24 Thread jsnark
carts.yml does not create the cart with id=1 that LineItem.find(1) refers to. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr..

[Rails] Re: Text field formatting

2013-09-11 Thread jsnark
Oops. <%= "#{@formatted_question[:question].gsub(/\n/, '').html_safe}" %> On Wednesday, September 11, 2013 8:46:16 AM UTC-4, jsnark wrote: > > > <%= "#{@formatted_question[:question].gsub(/\n/, '')}" %> >> >> -- You re

[Rails] Re: Text field formatting

2013-09-11 Thread jsnark
> <%= "#{@formatted_question[:question].gsub(/\n/, '')}" %> > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegrou

[Rails] Re: not able to find Gem file netbeans

2013-09-03 Thread jsnark
Netbeans dropped support for rails. The last version to include rails is 6.9.1. It is slightly buggy, but I use it all the time. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails

[Rails] Re: Why NaN.class throws NameError ?

2013-08-27 Thread jsnark
class Foo Bar = 10 end # => 10 Foo::Bar # => 10 Foo::Bar.class #=> Fixnum Bar.class NameError: uninitialized constant Object::Bar from (irb):6 from /usr/local/ruby-1.9.2/bin/irb:12:in `' On Tuesday, August 27, 2013 6:20:07 AM UTC-4, Ruby-Forum.com User wrote: > > Here is my sampl

[Rails] Re: What is this error

2013-08-21 Thread jsnark
This code needs to be refactored. It is way too long. Many lines are too long. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubs

[Rails] Re: second cucumber scenario fails

2013-05-28 Thread jsnark
Solved. Pilot error. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to

[Rails] Re: second cucumber scenario fails

2013-05-24 Thread jsnark
I'm finding I can reproduce the problem from 'rails server', so it has nothing to do with cucumber. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyo

[Rails] second cucumber scenario fails

2013-05-24 Thread jsnark
How can this be??? I have two cucumber scenarios. Both work individually, but when I put @wip in front of both of them, the first succeeds and the second one fails. I switched the order in the feature file and still the first succeeds and the second one fails. The error is: No route matches

[Rails] Re: Skip index in array.each_with_index loop

2013-05-23 Thread jsnark
Write a loop that generates the desired indexes and then reference arr: (0..5).each do |j| i = 10*j puts "#{arr[i]} at #{i}" end Your example output does not match the code. It does not include 0, 20, and 40. On Thursday, May 23, 2013 5:24:36 AM UTC-4, Ruby-Forum.com User wrote: > > Can an

[Rails] Re: How to stop webrick daemon

2013-04-30 Thread jsnark
The usual way to start webrick in RoR is with the command: $ rails s and the usual way to stop it is to enter CTRL-C in the same window. On Monday, April 29, 2013 11:05:51 PM UTC-4, Ruby-Forum.com User wrote: > > Tom wrote in post #109027: > > ... > > > I usually do this: > > > ps aux | grep

[Rails] Re: How to create new tables while running (automatically)

2013-04-29 Thread jsnark
You can execute SQL statements in a rails application with the command: ActiveRecord::Base.connection.execute('your sql') http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html#method-i-execute On Sunday, April 28, 2013 7:31:41 AM UTC-4, Anton Kanter wrote: >

[Rails] Re: yaml not escaping break line in double quoted string

2013-04-10 Thread jsnark
You did not say how this is being displayed. If it is being displayed on a web page, new lines are always discarded. You need to use '' instead of '\n'. On Wednesday, April 10, 2013 4:29:11 AM UTC-4, Erwin wrote: > > it's weird, as yaml doc stating it should work : > > en: >> site_under_main

[Rails] Re: adventures with rails, cucumber, selenium, and a database

2013-03-15 Thread jsnark
s? why didnt the tests see > the difference on the database when using MySQL? > > On Thursday, 14 March 2013 18:46:23 UTC+1, jsnark wrote: >> >> I run the tests using: >> >> $ bundle exec cucumber >> >> It is my understanding that cucumber is built on top of

[Rails] Re: adventures with rails, cucumber, selenium, and a database

2013-03-14 Thread jsnark
solated as possible, so your next test shouldnt > depend on if the one before fails or passes and what does on the database. > > On Wednesday, 13 March 2013 15:14:53 UTC+1, jsnark wrote: >> >> I have a rails 3.0 application with complicated logic and was finding >> that ch

[Rails] adventures with rails, cucumber, selenium, and a database

2013-03-13 Thread jsnark
I have a rails 3.0 application with complicated logic and was finding that changes to fix a bug would introduce another bug elsewhere. I needed an automatic regression test tool so I could quickly know if this happened. I am using cucumber for this. I know that I am not doing BDD or TDD, but

Re: [Rails] rails 3.0.19 and exception notification 3.0.0 do not play well together

2013-01-31 Thread jsnark
On 30 January 2013 18:57, jsnark > wrote: > > Ever since I upgraded my applications to rails 3.0.19 due to the > security > > issue with older versions, exception notification has stopped working. > What > > is the fix for this problem? Thank you. > > > &g

[Rails] rails 3.0.19 and exception notification 3.0.0 do not play well together

2013-01-30 Thread jsnark
Ever since I upgraded my applications to rails 3.0.19 due to the security issue with older versions, exception notification has stopped working. What is the fix for this problem? Thank you. Rendered /var/www/rails/xxx/shared/bundle/ruby/1.9.1/gems/exception_notification-3.0.0/lib/exception_no

Re: [Rails] update_attributes clears password

2012-07-31 Thread jsnark
On Monday, July 30, 2012 6:40:51 PM UTC-4, pavling wrote: > > On 30 July 2012 22:39, jsnark wrote: > > I understand the problem now, but I do not see the solution. The model > has > > a before_save filter that is causing the password to be reset. How do I >

Re: [Rails] update_attributes clears password

2012-07-30 Thread jsnark
On Monday, July 30, 2012 4:07:20 PM UTC-4, pavling wrote: > > On 30 July 2012 20:23, jsnark wrote: > > The hash does not contain a password key/value pair. In spite of this, > the > > password is set to the empty string. > > What filters run in the model? What obs

Re: [Rails] update_attributes clears password

2012-07-30 Thread jsnark
On Monday, July 30, 2012 2:39:22 PM UTC-4, pavling wrote: > > > On 30 Jul 2012 18:14, "jsnark" wrote: > > > > I have a database table that contains encrypted passwords along with > other information relating to users. When I do an update_attributes > o

[Rails] update_attributes clears password

2012-07-30 Thread jsnark
I have a database table that contains encrypted passwords along with other information relating to users. When I do an update_attributes operation on a row in the table with a hash that does not contain a password, the password gets reset to the empty string. How can I stop this? -- You rece

[Rails] Re: ActionView::Template::Error (undefined method `strftime' for nil:NilClass)

2012-06-26 Thread jsnark
The message says that enewsletter.publication_date is nil. Check the database to make sure that all instances have a valid date for this field. you should add a validation to the model to prevent creating a row with a nil value. On Tuesday, June 26, 2012 8:33:31 AM UTC-4, yatta20 wrote: > > H

[Rails] Re: how to implement SSO in ruby

2012-05-08 Thread jsnark
Check out http://code.google.com/p/rubycas-server/ and http://code.google.com/p/rubycas-client/ On Tuesday, May 8, 2012 4:03:15 AM UTC-4, honey ruby wrote: > > hi all i am trying to implement SSO in ruby on rails site . is there > any chance to implement SSO . > kindly help out > > Thanks

[Rails] Re: What can I use instead of (.grep)?

2012-04-20 Thread jsnark
Old: string.grep(/re/) New: string =~ /re/ On Apr 19, 6:00 pm, Loren wrote: > Hi, > > I am new to ruby and to programming in general. > I am learning from an outdated book and just realized that the .grip > method can no longer be used on strings since ruby 1.9. > > My question is could you plea

[Rails] Re: generated rjs replaces web page

2012-04-12 Thread jsnark
I also had to replace say_when.js.rjs with say_when.js.erb: $('#time_div').html('The time is <%= DateTime.now.to_s %> ') On Apr 12, 11:47 am, jsnark wrote: > Solved my own problem.  The link_to should be: > > <%= link_to( "click here", {:action=

[Rails] Re: generated rjs replaces web page

2012-04-12 Thread jsnark
Solved my own problem. The link_to should be: <%= link_to( "click here", {:action=> 'say_when', :format => :js}, :remote => true, :method => :post ) %> -- 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] generated rjs replaces web page

2012-04-11 Thread jsnark
I am running Rails 3.0.7 with Ruby 1.9.2 and using jquery. I ran $ rails generate jquery:install to get the right javascript files for AJAX. HTML: <%= javascript_include_tag :all %> ... I don't have the time, but <%= link_to( "click here", :action=> 'say_when', :remote => true, :format =>

[Rails] Re: Can't Use SQLITE3 as Rails Server

2012-03-07 Thread jsnark
That's because sqlite3 is a database server and not a web server. $ rails server starts the default web server, WEBrick. Mongrel and thin are some common alternatives. On Mar 5, 1:25 am, Gjaldon wrote: > Hi all, > > Need some help with setting my rails server as sqlite3. I'm currently > follow

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-20 Thread jsnark
I found the solution. Insert the line: require "bundler/capistrano" into deploy.rb On Jan 17, 8:52 am, jsnark wrote: > Could not find net-ssh-2.2.2 in any of the sources > (Bundler::GemNotFound) > > $ ls -l vendor/cache/net* > -rw-rw-r-- 1 xxx xxx  27136 2012-01-

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-17 Thread jsnark
e_flags in the capistrano documentation. On Jan 17, 6:00 am, Xuan wrote: > On 16 ene, 15:54, jsnark wrote: > > > Oops.  Pilot error. > > > set :bundle_flags, '--local' > > > did not work. > > > On Jan 16, 9:43 am, jsnark wrote: > > Usual

[Rails] Re: Need advice - one large application or many small ones?

2012-01-17 Thread jsnark
asier. On Jan 16, 11:48 pm, Aline de Oliveira Freitas wrote: > just for me to get it.. why did you separeted in mini apps in the first > place? What motivaded you? What were the reasons that led you to do that? > > 2012/1/16 jsnark > > > What additional information do you nee

[Rails] Re: Need advice - one large application or many small ones?

2012-01-16 Thread jsnark
What additional information do you need? What are the tradeoffs? -- 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 rubyo

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-16 Thread jsnark
Oops. Pilot error. set :bundle_flags, '--local' did not work. On Jan 16, 9:43 am, jsnark wrote: > On Jan 16, 9:25 am, Xuan wrote: > > > If you add '--local' to your 'set :bundle_flags' statement, capistrano > > will automatically look into

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-16 Thread jsnark
On Jan 16, 9:25 am, Xuan wrote: > If you add '--local' to your 'set :bundle_flags' statement, capistrano > will automatically look into vendor/cache for the gems during the > deploy process without extra work. > They should be previously packaged with bundle package. Thank you. That's what I

[Rails] Need advice - one large application or many small ones?

2012-01-16 Thread jsnark
I have about 20 relatively small applications running on the server. They mostly access the same database tables. Is it more efficient to combine them into a single application with lots of controllers or to keep them as separate applications. ruby 1.9.2 rails 3.0.1 capistrano 2.9.0 passenger 3.0

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-16 Thread jsnark
On Jan 13, 3:39 pm, "Steven F." wrote: > Where did you run "bundle install --path vendor/cache"?  On the > development machine, or the server? I ran the bundle install command on the server after deploying the application. > Has there been any progress with a work-around? No. Based on your

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-11 Thread jsnark
On Jan 11, 2:52 pm, Colin Law wrote: > So the question is, what is the difference between > bundle pack > and > bundle install --path vendor/cache > > Colin I found the pack command in "Agile Web Development with Rails", fourth edition on page 235. I stumbled across the install command while

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-11 Thread jsnark
On Jan 11, 11:55 am, Colin Law wrote: > Because that is what bundle install is for, to install the appropriate > gems as defined by Gemfile and gemfile.lock. > The one thing I am not sure of is why it did not work when the gems > were already in vendor/cache.  How did you get them there in the

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-11 Thread jsnark
Correction. I'm actually running rails v3.0.7. -- 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-talk+unsubs

[Rails] passenger does not see gems in vendor/cache

2012-01-11 Thread jsnark
I am using capistrano v2.9.0 to deploy to a ubuntu server running apache v2.2.12, passenger v3.0.4, ruby v1.9.2 and rails v3.0.1. When I deploy a new application, I often get error messages like: Could not find net-ssh-2.2.2 in any of the sources (Bundler::GemNotFound) The missing gem is actuall

[Rails] Re: Convert html entities? Just use html_safe?

2011-12-27 Thread jsnark
It depends. If the strings are entered by the user you should stay away from using html_safe because you open your application to html injection attacks. If the strings come from a trusted source, it is OK to use html_safe. On Dec 18, 5:50 pm, Linus Pettersson wrote: > Hi! > > I'm importing lot

[Rails] Re: help with temporary database tables

2011-12-13 Thread jsnark
Fred, Thank you so very much for your response. If I am understanding you correctly, you are confirming my conclusion that the only way to use temporary tables with sqlite3 and mysql is to use raw SQL. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: help with temporary database tables

2011-12-12 Thread jsnark
It's now been a month since I made this post and have not received a response. I am assuming that is because the only way to use temporary database tables from Ruby is to write raw SQL. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To

[Rails] help with temporary database tables

2011-11-12 Thread jsnark
I'm running Ruby 1.9.2 and Rails 3.0.7. I'm having problems inserting data into a temporary database table. I can create a temporary table with the code: class TempHelper def self.create_temp begin ActiveRecord::Schema.define do create_table (:temps), :temporary => true do |t