Displaying 20 results from an estimated 10000 matches similar to: "Using an ActiveRecord model in routes.rb"
2010 Jul 12
2
[R3B4] errors[:base] = appends, doesn't "set" - bug, feature, or "error 18"?
If you haven''t heard, an "error 18" means "the error is 18 inches from
the screen." Which would mean that I totally get that this could just
be me being stupid.
However, for some reason I''m thinking this violates the normal
behavior of an Array object, so I''m curious as to if I''m doing
something wrong here, or if something really is buggy
2011 Mar 07
1
has_one :dependent => :destroy error (in `configure_dependency_for_has_one': compile error (SyntaxError))
Hi I''m getting the following error :
/Users/nikosd/.rvm/rubies/ree-1.8.7-2011.02/bin/ruby -e
$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
/Users/nikosd/.rvm/gems/ree-1.8.7-2011.02@.../bin/rake test
Testing started at 12:00 PM ...
(in /Users/nikosd/Work/.../.../...)
2007 Sep 18
2
rSpec / Nested Routes / Mocks
I''m having a terrible time trying to test a nested route with rSpec.
I can''t seem to tell rSpec to expect the call @item.user. The
following error message plagues me not matter how I try to fuss with
the mock:
Spec::Mocks::MockExpectationError in ''ItemsController handling POST /
items should redirect to the new course on successful save''
Mock
2011 Apr 12
0
RVM no such file to load
Hi,
I installed rvm recently I have a problem when I launch the rails 3
console ( or rails 3 app) it doen''t find my gems.
Here is my console:
Loading development environment (Rails 3.0.3)
ree-1.8.7-2011.03 :001 > require "rubygems"
=> nil
ree-1.8.7-2011.03 :002 > require "simple-rss"
LoadError: no such file to load -- simple-rss
from
2011 Jan 16
1
Before and After Filters/Functions for Rails Routes
Hi
I have an idea and I am not sure if is is already done.Right now to make url
search engine friendly developers use to_param function of model class. Then
they call to_s function to get the id of the elmenet. What if I want to
create url for not model but for string. Lets say I create link for post
controller''s search action. The only variable in the url is search_string.
Si how
2011 Mar 16
2
Increased memory and cpu usage when migrating from MRI 1.8.6 to REE 1.8.7
Hello,
We''ve been migrating our fairly large Rails 1.2 application from MRI 1.8.6
to REE 1.8.7, and in the process we''ve encountered some fairly odd behavior.
Namely, instead of the expected reduction in memory usage, we''re seeing an
increase in memory usage by around 40% and, along with it, an increase in
processor usage.
The stock 1.8.7 implementation performs
2011 Mar 24
0
How can I change from ruby/mysql to mysql/ruby module? [Broken PIPE problem..]
Due to the random broken pipe error in rails, (probably due to timed
out mysql connection) I am trying to use Mysql/ruby (which was coded
with C) instead of ruby/mysql (which was coded in Ruby).
Ruby/Mysql -> http://www.tmtm.org/en/ruby/mysql/README_en.html
Mysql/Ruby -> http://www.tmtm.org/ja/mysql/ruby/README.html
Related Article about Broken pipe problem ->
2006 Feb 01
0
to_param() / url generation Question
I''m trying to implement the to_param method to allow url generation to
be in the format of /:category_name/:article_permalink (as discussed on
page 299 of Agile Web Development With Rails).
I expect that I need to override/implement the to_param method and have
it return the category_name for the category model and the
article_permalink for my article model, but I haven''t
2007 Oct 08
6
spec''in controllers request for nested routes
describe PlayersController, "handling GET /saltmines/games/1/players" do
before do
@game = mock_model(Game, :to_param => "1")
@game.stub_association!(:players, :find => mock_model(Player))
end
def do_get
get :index, :game_id => @game
end
it "should be successful" do
do_get
response.should be_success
end
it "should
2011 Mar 02
1
Member route error
I''m getting a RoutingError for a member route I can''t figure out. I''m
posting a simple form that has a submit button as a confirmation step.
Here''s the route:
# routes.rb
resources :orders do
post ''confirm'', :on => :member
end
1) "rake routes" shows it''s there:
confirm_order POST /orders/:id/confirm(.:format)
2006 Apr 07
2
ActiveRecord find all based on array -- need ids from array
Does anyone know if it is possible to perform an ActiveRecord find by
passing in an array? I would like to be able to do the following:
MyModel.find(:all, :conditions => ["user_id in (?)", users])
The problem I run into is that the returned SQL contains the to_s()
output of the User object, not the ids of those users. Is it possible
to change this behavior? I attempted to
2010 Nov 29
0
rake aborted! getaddrinfo: Name or service not known
I''m deploying new rails applications. Everything works well
except when it comes to the db migration:
* executing "cd /var/rails/benefits_test/releases/20101129190121 &&
/opt/ruby-enterprise-1.8.7-2010.02/bin/rake RAILS_ENV=production
db:util:migrate"
servers: ["ps-test-app1"]
[ps-test-app1] executing command
** [out :: ps-test-app1] (in
2010 Nov 30
2
db migration fails
I''m deploying new rails applications. Everything works well
except when it comes to the db migration:
* executing "cd /var/rails/benefits_test/releases/20101129190121 &&
/opt/ruby-enterprise-1.8.7-2010.02/bin/rake RAILS_ENV=production
db:util:migrate"
servers: ["ps-test-app1"]
[ps-test-app1] executing command
** [out :: ps-test-app1] (in
2006 Apr 20
0
Custom path overriding - routes.rb
I want to be able to have custom URL paths to some of my data.
For example, I might have some entries in my "item" table like:
id=1, title="Test", path="/test.html", content="some test content..."
id=2, title="Example", path="/another/example/", content="some
example content..."
id=3, title="Some more",
2006 Mar 04
0
Reading from Session in routes.rb?
Hi all,
I''m developing some custom routes for an application and am creating the
aliased url_for commands that I like so much. However, one of the things I''d
like to do is read a string from the session (or possibly even pull out an
object to get to the string) and use that in the URL generating by the route
-- without having to pass the string into the url_for alias every time.
2012 Feb 01
0
Rails 3.1 form & routes.rb [newbie]
Hi all,
maybe is a newbie question anyway
1. I create de rails app with
# rails new {my app}
2. after I add some gem to my Gemfile
source ''http://rubygems.org''
gem ''rails'', ''3.1.1''
gem ''sqlite3''
gem ''simple_form''
gem ''execjs''
gem ''therubyracer''
# Gems used only
2007 Apr 30
0
Cache routes.rb in development?
My routes.rb files uses resources and building the routes for each
request takes a while. Is it possible to cache the routes during
development, like they do in production, but without caching everything
else?
Thanks for your help.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
2008 Jul 19
2
renaming routes.rb
When you create a new rails app the default home page says to rename
routes.rb. I tried this, but when I run script/console or script/server
I get an error saying the routes.rb file can''t be found. If you rename
this file is there an environment variable holding the location
elsewhere in the application?
--
Posted via http://www.ruby-forum.com/.
2006 Jul 14
0
Newbie: Application Error (Rails) no such file to load -- ../config/../config/routes.rb
Hello,
I am getting an ''application error (rails)'' error
whenever I try to access my application from
index.html.
The application WAS working fine.
If I look into development.log, I see the msg:
no such file to load -- ../config/../config/routes.rb
BUT the files does exist in the expected directory.
I did have some problems with Suse (GRUB loader) in
between last accessing
2006 Jun 30
1
using routes.rb from inside a controller / render_component_as_string / generally stumped
Hi,
In an action I have a string representing a url for a get request. A
simple and seemingly ridiculous example might be something like the
following. What I''m trying to do is much more complicated but I think
this tiny example shows where I am stuck.
Into their browser a user types
"http://my.domain.com/admin/category/updates". I have a controller
roughly like the following