[Rails] Re: New Project needs push notifications

2014-09-30 Thread Perry Smith
Thank you to Vivek and Jason. One extra note: this is an internal restricted web site so I can't use Heroku for this particular project but that type of information is also interesting to me. On a side note: in the past, I've used Apache. Sometimes with Passenger and sometimes without. I'm c

[Rails] New Project needs push notifications

2014-09-30 Thread Perry Smith
I'm starting a new Rails project probably using 4.1 or 4.2. The project needs the ability for user's browsers to get updates via push notifications. I know that Rails 4 kinda sorta added that but the last time I looked it was shaky. To sketch out what I'd like: suppose a user is looking at a pag

[Rails] asset pipeline slight rethink?

2012-10-15 Thread Perry Smith
st to encounter this. I am wondering what others are doing or considering doing. Thank you, Perry Smith -- 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 r

[Rails] How to set relative root in Rails 3.2.3

2012-07-04 Thread Perry Smith
I need to have my rails root at a relative path. Setting env RAILS_RELATIVE_URL_ROOT does not seem to work. And setting config.action_controller.relative_url_root also does not work. At least, I haven't been able to get either of them to work. Thank you for your help, pedz -- Posted via http:/

[Rails] Re: Re: Re: foo_path not defined

2012-06-06 Thread Perry Smith
Jeremy W. wrote in post #1063404: > On 6 Jun 2012, at 18:21, Perry Smith wrote: > >>> at previous messages to check your code (myself included). >>> Colin >> <%= link_to "pogo", pogo_path(1234) %> >> >> in my view. >> >> I

[Rails] Re: Re: foo_path not defined

2012-06-06 Thread Perry Smith
Colin Law wrote in post #1063357: > On 6 June 2012 15:33, Perry Smith wrote: >> Thanks. >> >> I checked http://guides.rubyonrails.org/routing.html first. The code I >> have, to my eyes, match the lead examples in sections 1.1 and 1.2. >> There must be something

[Rails] Re: foo_path not defined

2012-06-06 Thread Perry Smith
Thanks. I checked http://guides.rubyonrails.org/routing.html first. The code I have, to my eyes, match the lead examples in sections 1.1 and 1.2. There must be something I'm overlooking. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the G

[Rails] foo_path not defined

2012-06-06 Thread Perry Smith
I have the usual: config/routes.rb: NewApp::Application.routes.draw do match('blahs/:item' => 'blahs#show', :constraints => { :item => /.*/ }) end app/view/blahs/show.html.erb: <%= link_to "blah", blahs_path() %> But I'm getting this error: undefined method `blahs_path' for #<#:0x007f96050

[Rails] jsrender, templates, assets, etc.

2012-06-01 Thread Perry Smith
ll my template files separately when in production. Just as all the javascript and all the css files are served up as one concatenated file, I'd like to serve all the templates up as one file when in production mode. Thank you for your time, Perry Smith -- Posted via http://www.ruby-foru

[Rails] Instrumenting ActiveRecord associations

2011-12-19 Thread Perry Smith
I may have fallen into Knuth's fundamental warning and optimized prematurely. My database has various foreign keys which are there to try and speed things up but they take time to maintain as well. Now I'm wondering if they are worth the time to maintain verses the time they save. Does anyone kn

[Rails] Re: Character encoding problems.

2011-09-06 Thread Perry Smith
Yes, I understand Ruby's encodings. That isn't my question. My question is what is a good consistent way to deal with the in Rails given that the input may be any language, you do not have control over the various source files in the gems, etc. i.e. since the rails files do not have the UTF-8

[Rails] Character encoding problems.

2011-09-06 Thread Perry Smith
I've been fighting these problems since I moved to Ruby 1.9. I am now using Ruby 1.9.2 with Rails 2.3.11 and I am still having problems. The symptom is errors with this message: (incompatible character encodings: UTF-8 and ISO-8859-1) I've marked all my files with: # -*- coding: utf-8 -*- and

[Rails] Re: Puzzling error

2011-08-10 Thread Perry Smith
Hi, Thanks. Yea. I'm trying to get this "stable" before moving to 1.9.2... but I'm getting into a circular problem. I was on 1.9.1 before 1.9.2 came out. So long story short it sounds like I don't want to use "config" as a namespace. Thank you for your help pedz -- Posted via http://

[Rails] Re: Question About Forms

2011-08-10 Thread Perry Smith
This is more of a design question. There is nothing wrong with many forms. And usually keeping things separate leads to more stable, easier to maintain code. So I would probably opt for many small forms rather than one big one. HTH pedz -- Posted via http://www.ruby-forum.com/. -- You re

[Rails] Puzzling error

2011-08-10 Thread Perry Smith
I am getting: uninitialized constant RbConfig::RetusersController My routes look like this: map.namespace(:config) do |config| config.resources :users do |user| user.resources :retusers end end and I am calling redirect with: redirect_to edit_config_user_retuser_url(a

[Rails] Re: Question About Forms

2011-08-07 Thread Perry Smith
| Example: In this page I | 1) send message to user, | 2) make one vote in one post, | 3) remove one post. I'm not 100% sure what you mean by #1 but I'll assume that it requires a text area and a submit button. I'd probably use a regular form for this although scriptaculous offers many "Web 2.0"

[Rails] Browser caching of javascript files

2011-08-07 Thread Perry Smith
I'm using the latest Firefox and firebug with Rails 2.3.11 (and Ruby 1.9.1). I see my javascript assets have the last modified date, such as: javascripts/prototype.js?123456789 which has been the case for a while. What I just noticed is that Firefox (according to Firebug) is fetching this f

[Rails] Multi User ActiveResource

2011-07-24 Thread Perry Smith
My higher level objective is to develop a way to move particular database entries from my development platform to my staging platform and then to my production platform. Unfortunately, there may be reasons to go the other way as well. And, these entries have "owners" and also are interconnected.

[Rails] polymorphic and sti problems.

2011-05-11 Thread Perry Smith
I'm way back at Rails 2.3.5. I can move up to 2.3.11 if anyone thinks that will help. My problem is this: class Entity < ActiveRecord::Base belongs_to :item, :polymorphic => true end class Name < ActiveRecord::Base has_one :entity, :class_name => "Entity", :as => :item

[Rails] Basic crud pages for STI models

2011-04-17 Thread Perry Smith
If you have a model that is using single table inheritance, the simple new, create, edit, and update methods and views might not do what you want them to do. I have an ActiveRecord::Base with just a name and a type so I can define a Team (type) of "account" and a Dept of Education. But suppose I m

[Rails] Route with optional segments

2011-03-31 Thread Perry Smith
In Rails 2.3.5, is this the proper way to do this? map.calls "calls/:group/:view/:subselect", :controller => 'calls', :action => 'index' map.calls "calls/:group/:view",:controller => 'calls', :action => 'index' map.calls "calls/:group", :controller => 'calls', :a

[Rails] Re: Debugging help needed

2011-03-29 Thread Perry Smith
Thank you very much for the pointers. I found the blogs and it made life very simple! -- 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@goog

[Rails] Debugging help needed

2011-03-28 Thread Perry Smith
I have an odd problem I'm stumped on how to debug. I'm running Rails 2.3.5 under rvm. I'm doing a new test that *should* work but it does not. My test is I clear my database so it is empty and then start a request. Its a complex application that interacts with another legacy server fetching thi

[Rails] actionpack-3.0.3/lib/action_dispatch/middleware/rescue.rb

2011-01-23 Thread Perry Smith
I was trying to understand how exceptions are caught. There are two rescue.rb files. One is under ActionController. I understand how it is invoked and what it does. But the one under action_dispatch I don't see how it gets used. I see the autoload for it in actionpack-3.0.3/lib/action_dispatch

[Rails] Re: Problems using postgresql (postgres-pr) gem

2011-01-15 Thread Perry Smith
Is it possible that when you do "gem" you are using a different copy of Ruby than if you run your rails application? There is at least one requirement here: activerecord-2.3.5/lib/active_record/connection_adapters/postgresql_adapter.rb (replace 2.3.5 with your flavor of Rails) begin require_

[Rails] Re: Problems using postgresql (postgres-pr) gem

2011-01-15 Thread Perry Smith
Postgres is confusing (to me). I install "pg (0.10.0)" and that is working for me. I'm currently toying with Rails 3 using Ruby 1.9.2 but I've done lots of Ruby 2 using Ruby 1.8 and 1.9.1. If you use the --database=postgresql option when you create your project, it will have this at the top:

[Rails] Merb exception stack

2011-01-15 Thread Perry Smith
In this thread: http://www.ruby-forum.com/topic/134298 the poster had a patch to create a stack trace that had "textmate" links it it. He opened a bug report: http://dev.rubyonrails.org/ticket/10401 I can't find that since dev.rubyonrails.org appears dead. I don't know if / how the old tickets

[Rails] "Clickable" error pages in development mode

2010-06-18 Thread Perry Smith
When I use merb or if I get an exception in Passenger, the page that is render has links for each of the source lines. These links I can click and it puts me into textmate. I have a hook so it puts me into emacs. Is there a way to get the regular development mode exception handling to do the sam

[Rails] Re: Widget

2010-06-09 Thread Perry Smith
Jeremy Axman wrote: > I am very new to Ruby. > > > Is there a way to create a Windows Widget that resides on a desktop and > allows direct access to a database.. > > For instance > > I can enter name and email on my desktop and hit submit. It will then be > directed to an existing database? >

[Rails] Re: LoadError: no such file to load -- gem not found in irb, but found in app console

2010-06-09 Thread Perry Smith
Kad Kerforn wrote: > no problem in the console > $ script/console > Loading development environment (Rails 2.3.8) >>> require 'vzaar' > => [] > > but when using irb, I get a LoadError... > re 'vzaar' > LoadError: no such file to load -- vzaar > from (irb):1:in `require' > from (irb):1 > > wh

[Rails] Persistent values and class variables

2010-06-09 Thread Perry Smith
I need to have a variable that points to a MemCache instance so I looked at the Rails caching code to see how they do it. They use a Ruby class variable (or a few of them). That surprised me since class variables in Ruby as so gnarly. I thought I would post the question here to see if anyone kne

[Rails] Re: Using update_attributes(params[:something]) w/ manual assignment

2010-05-28 Thread Perry Smith
> So I guess this rules out all but a some plugin interference; I'll look > into it; > Do you know of a good way to do this? What database are you using? Maybe this feature is just for some of the databases but not all? (That wouldn't make much sense to me but its a thought.) It seems like

[Rails] Re: Using update_attributes(params[:something]) w/ manual assignment

2010-05-28 Thread Perry Smith
Jose Ambros-ingerson wrote: > Frederick Cheung wrote: >> On May 27, 10:55�pm, Jose Ambros-ingerson >> wrote: >> >> Actually that bit in the logs show the name getting set to spanish as >> well. It's also possible that you've turned off this behaviour - >> ActiveRecord::Base.partial_updates (or so

[Rails] Re: Using update_attributes(params[:something]) w/ manual assignment

2010-05-27 Thread Perry Smith
Jose Ambros-ingerson wrote: > Jose Ambros-ingerson wrote: >> Perry Smith wrote: >> >>> >>> By the way, update_attributes calls save (as of 2.3.2? or was it before >>> that) only if at least one attribute has changed. >> > > Though failure

[Rails] view (or template) to helper to view ... magic

2010-04-29 Thread Perry Smith
I early Rails 2, I wrote code in my show.erb.html file like this: <% display_qs_body(binding) %> display_qs_body was in a helper file and it passed binding along and used (as I recall) concat(binding, "text"). concat changed so you no longer passed binding somewhere later in Rails 2. I ca

[Rails] Re: Fragment caching strategy

2009-10-02 Thread Perry Smith
Philip Hallstrom wrote: > > Seems reasonable. As long as you're sure your cache will expire the > old entries and not keep piling them up until you run out of ram/disk > space. > I'm using memcache. I'll research and double check and make sure it just pushes things out the cache. The altern

[Rails] Fragment caching strategy

2009-10-02 Thread Perry Smith
Right now, I have the :action_suffix for a fragment I cache such that I can find it when I need to delete it from the cache. But an episode on Rails Casts gave the idea that another approach is to not worry about deleting the old fragments. They will eventually just get pushed out of the cache.

[Rails] Re: Caching Warning

2009-06-10 Thread Perry Smith
Frederick Cheung wrote: > On Jun 10, 1:45�pm, Perry Smith > wrote: >> Frederick Cheung wrote: >> >> > apache/nginx rewrite rules can do this >> >> I'm worried about redirects. �The server is behind a firewall. �The >> browser thinks th

[Rails] Re: Caching Warning

2009-06-10 Thread Perry Smith
Frederick Cheung wrote: > > apache/nginx rewrite rules can do this > I'm worried about redirects. The server is behind a firewall. The browser thinks that foo.outside.com is different from foo. If I am authenticated to foo.outside.com and then foo happens to ask for authentication, the br

[Rails] Re: Using update_attributes(params[:something]) w/ manual assignment

2009-06-09 Thread Perry Smith
Phoenix Rising wrote: > So - and somebody please verify or correct my understanding - as long > as the hash I pass in to update_attributes doesn't overwrite my prior > manual assignment methods, this functionality should continue - > through future updates to the framework - to work as expected -

[Rails] Re: Using update_attributes(params[:something]) w/ manual assignment

2009-06-09 Thread Perry Smith
I don't see the "multiple" calls to save. update_attributes will call save but I don't see the other call to save. By the way, update_attributes calls save (as of 2.3.2? or was it before that) only if at least one attribute has changed. -- Posted via http://www.ruby-forum.com/. --~--~

[Rails] Re: Foreign Key (Mysql/Rails)

2009-06-09 Thread Perry Smith
I happen to be reading about this last night except I was reading about it in the PostgreSQL manual. In the case of PostgreSQL, the planner searches for the least expensive plan and uses different plans based upon the "selectivity" of the constraint. The PostgreSQL doc may give you a clue wha

[Rails] Caching Warning

2009-06-09 Thread Perry Smith
This might be considered a bug... but I thought I'd at least warn folks. I'm using fragment caching and the host name is in the key of the fragment. The problem is that this is the host name used in the URL. So, if you have two or more ways to get to the same host, you will have multiple version

[Rails] Re: Abbreviated stack when using runner

2009-06-06 Thread Perry Smith
Maurício Linhares wrote: > Look for the file config/initializers/backtrace_sileners.rb > > And leave it just like this: > > # Be sure to restart your server when you modify this file. > > # You can add backtrace silencers for libraries that you're using but > don't wish to see in your backtrace

[Rails] Abbreviated stack when using runner

2009-06-06 Thread Perry Smith
When I use script/runner and get an exception, the stack that is printed often has something like: from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:200:in `save!' ... 9 levels... from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.2

[Rails] How do others handle no-cache ?

2009-06-03 Thread Perry Smith
The browser can append to the request a 'no-cache' option and other options. Firefox sets this if you do a refresh with the shift key down (at least on the Mac). I am considering expiring all of my fragments that are cached for that particular request before proceeding with the request if no-cac

[Rails] DB field documentation suggestions wanted

2009-05-20 Thread Perry Smith
Where do folks generally document their database attributes? They appear as attributes (or methods) to the model. Is there a way to add pseudo methods so that rdoc picks them up along with their documentation but they are not really defined in the ruby code? Or do people just add comments for t

[Rails] Caching question

2009-05-15 Thread Perry Smith
I have a strange set up where my Rails app is essentially a front end for a legacy system. When I request comes in, the Rails application asks the legacy system "is the data I have cached up to date?" If it is not, then I fetch a fresh copy and in that case, I would have to redraw the page. But

[Rails] ActiveRecord Constraints

2009-04-24 Thread Perry Smith
A plugin to easily add constraints into a PostgreSQL database. I think it would be easy to add other database engines to it assuming they implement constraints. The GIT repository is here: http://github.com/pedz/activerecord_constraints The rdoc is here: http://pedz.github.com/activerecord_co

[Rails] Re: Not quite a rails question but can anyone advise?

2009-04-22 Thread Perry Smith
Gavin Morrice wrote: > libMagickCore.so.1: cannot open shared object file: No such file or > directory - /usr/lib/ruby/gems/1.8/gems/rmagick-2.9.1/lib/RMagick2.so > (LoadError) > > Anybody have any idea why this is? I bet if you look under a similar path except add in local you will find the li

[Rails] Re: Not quite a rails question but can anyone advise?

2009-04-21 Thread Perry Smith
Gavin Morrice wrote: > PS - although adding the path to .bash_profile works in the shell, it > doesn't work when I start up my app using the facilities provided by > my host > > -is that normal? That's the kind of thing I was worried about. I would ask your hosting site how to set the load pa

[Rails] Re: Not quite a rails question but can anyone advise?

2009-04-20 Thread Perry Smith
Wouter de Bie wrote: > Gavin Morrice wrote: >> Actually - scrap that >> >> I just tried adding ENV['LD_LIBRARY_PATH']="/usr/local/lib:#{ENV >> ['LD_LIBRARY_PATH']}" >> to the environment.rb file >> >> This doesn't seem to work >> >> I also added puts ENV['LD_LIBRARY_PATH'] to see if it recognis

[Rails] stack trace with test

2009-04-19 Thread Perry Smith
I'm working on tests for a plugin using Rails 2.3.2 and Ruby 1.8.6. Often when my code is broken, the test simply says the error but I can't get the stack trace back. Is there some way I can do that? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~

[Rails] Re: Not quite a rails question but can anyone advise?

2009-04-19 Thread Perry Smith
Gavin Morrice wrote: > added > > export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH > > to my .bash_profile file > > Seems to have done the trick. > > :) I'd revisit that if I were you. In the final deployment, you are likely going to run the server as someone other than you. And, the

[Rails] Re: Request Profiling on Rails 2.3.2

2009-03-26 Thread Perry Smith
Perry Smith wrote: > scripts/performance/request is gone... and the RequestProfiler class is > gone from ActionController. > > Is there a simple way to profile a request? I found the guide... sorry. http://guides.rubyonrails.org/performance_testing.html -- Posted via htt

[Rails] Request Profiling on Rails 2.3.2

2009-03-26 Thread Perry Smith
scripts/performance/request is gone... and the RequestProfiler class is gone from ActionController. Is there a simple way to profile a request? Thanks pedz -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are

[Rails] PDF showing which items each generator creates

2009-03-15 Thread Perry Smith
Enjoy... pedz Attachments: http://www.ruby-forum.com/attachment/3441/Rails_Generators.pdf -- 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 p

[Rails] Page with download

2009-02-21 Thread Perry Smith
I want to have a single link that displays a page and also starts a download. Is that possible? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

[Rails] Re: how to determine if a database column has been set?

2008-11-14 Thread Perry Smith
Also, if you are interested. NULL values in database tables, by the super DB guys like Date and Pascal, are frowned upon. They create "three way logic" which often yields unexpected results and is not part of boolean algebra and is outside of the theory that relational DB is based upon. The

[Rails] Re: Where should data migrations go?

2008-11-14 Thread Perry Smith
How about just a small script that you run with "script/runner" ? -- 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 e

[Rails] Re: how to determine if a database column has been set?

2008-11-14 Thread Perry Smith
The database query that you want is foo.odometer IS NULL (for when it has not been set) or IS NOT NULL (for when it has ben set). You could google ActiveRecord and "IS NULL" and see if you find hits. I *think* the code does this correctly. e.g. Table.find(:all, :conditions => { :odomiter =>