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
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
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
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:/
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
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
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
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
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
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
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
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
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://
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
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
| 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"
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
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.
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
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
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
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
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
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
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_
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:
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
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
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?
>
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
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
> 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
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
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
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
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
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.
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
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
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 -
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/.
--~--~
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
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
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
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
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
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
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
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
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
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
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
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/.
--~--~-~--~~~---~--~
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
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
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
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
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.
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
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
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 =>
61 matches
Mail list logo