Displaying 20 results from an estimated 200 matches similar to: "Need help creating a clever route"
2006 Mar 10
3
External controller code
Hey,
we like to realize a RoR project with a huge amount of controller code.
What is the best way to handle that.
Is there a similar mechanism for helper as for views or a way to
include/load external code?
Otmar Tschendel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060310/789a3fad/attachment.html
2006 Apr 18
7
Connecting to multiple databases
Hi Everyone,
I am trying to connect to multiple databases and followed along the
Recipe in Chad Fowlers ''Rails Recipes'' book (which basically is about
establishing the connection in a subclass of ActiveRecord::Base, and
inheriting all classes in need of this connection from this class)
Chad Fowler says:
"You won''t be able to instantiate an External, of course,
2006 Jan 22
6
*Very* basic layout question
I''m trying to use a different layout for just one action in my
controller, all the other actions use the application.rhtml layout, so
what i''m doing is ...
class SomeController < ApplicationController
layout "simple", :only=> :some_action
......
end
and the "simple" layout is applied to all the actions, can someone
please give me a hint?
2011 May 25
1
warning: toplevel constant SomeController referenced by Admin::SomeController
This issue has been discussed before (http://www.ruby-forum.com/topic/
125392) and after spending a while debugging through this, I still
don''t have a solution. Lets try again?
I have two controllers, SomeController and Admin::SomeController. When
SomeController is loaded first (which happens under spork, found out
by editing ActiveSupport::AbstractController) I get warning: toplevel
2005 Dec 20
1
Model method_missing error (rforum)
I''m attempting to get rforum working. I pulled it from the subversion
repository.
Everything works fine until I attempt to make a post.
I get the following error.
c:/apps/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1498:in
`method_missing''
#{RAILS_ROOT}/app/controllers/topic_controller.rb:80:in `new''
2009 Apr 24
4
Undefined method "redirect_to" in before_filter
Code sample:
class SomeController < ApplicationController
before_filter do |c|
add_crumb "Blah", "/blah" #breadcrumbs plugin
redirect_to :controller => "foo", :action => "bar" unless c.send
(:has_package?)
end
# Rest of the controller...
private
def has_package?
# A bunch of logic work to check to make sure
# somebody''s session contains
2006 Apr 22
3
Creating a select dropdown box with links to methods
What would be the best way to create a form select dropdown box and upon
"submit" have it directly go to a controller method view?
I have something that somewhat works, but I think there is probably a
much easier way to do it. As of now, I have the dropdown list which
when the form is submitted is handed to a controller method which
basically
I have my dropdown box:
<%=
2006 Apr 03
16
Dealing with Application error (Rails) in production
Hi all,
Week 2 working with Ruby on Rails... I have a working app in development
that is now throwing a generic, "Application error (Rails)" message in
production.
How do I deal with this so I can find more information about why the
error is being thrown in production, but not in development?
Thanks!
--
Posted via http://www.ruby-forum.com/.
2008 Mar 08
7
ridding away with do_request
I''m heading out of town, but had a quick thought I wanted to share.
Rather then using ambiguous named request helpers in controller specs
like "do_request", I''ve been using more readable helpers like
"post_create".
For example...
describe ProjectController do
def post_create
post :create, ...
end
before do
end
it "creates a new
2007 Nov 23
12
namespaced controllers
Out of curiosity, I''ve seen the following fail:
module Admin
describe MyController
...
end
end
But this works fine:
describe Admin::MyController
..
end
Why?
Scott
2006 Aug 29
1
Scope problem with form_remote_tag, ajax?
Hi all,
I have tracked an odd behavior down to what I think is an issue of
scope. In short, when I use form_remote_tag to establish an AJAX form,
my database fields don''t get populated when performing an edit on the
record. Those same fields will get populated using start_form_tag and
no AJAX. I think that Ruby can''t find the local object that represents
the database
2007 Jan 18
2
How to use API from AWS -- help!
I''m building a users web service (direct dispatching) that will (I hope)
allow several other applications to manage the same pool of users. Plus
it will act as a single-sign-on solution for what I''m doing. But I''m
having difficulty accessing the UserAPI. Here''s what I''ve done so far:
$> rails usermanagement
- "usermanagement" is the
2012 Dec 01
6
Why does 'extend ActiveSupport::Concern' cause `undefined method 'recycle!'`?
Working on Rails Engine.
I want to make the controllers customizable whereever the Rails Engine is
used.
Therefore, I was trying to use `extend ActiveSupport::Concern` on the
Engine controller class and include it in MyRailsApp.
https://gist.github.com/4185823
# code in my rails engine
moduel MyEngine
class SomeController
extend ActiveSupport::Concern
def engine_some_method
2009 Apr 06
9
setup method in functional tests and instance variables
I have the following in my functional test file.
class UserControllerTest < ActionController::TestCase
fixtures :users
def setup
@controller = UserController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@invalid_user = user(:invalid_user)
@valid_user = users(:valid_user)
end
def test_login_success
2006 Apr 22
7
Instance variables versus local variables
This novice coder roughly understands the difference between instance
and local variables thanks to David Black''s excellent book, but I''m
still unclear as to when and why a either is more desirable to use.
In general, I use instance variables in my controller and local in my
views, but I''m not sure as to why or if this is correct.
Thanks
Joe Kowalski
2005 Dec 18
1
problems with text_field_with_autocomplete
I''m trying to set up a search field with autocomplete. I have verified
that the server is called when I type a letter in the box, and that the
handler creates the correct instance variable. However, I never see the
partial that is supposed to be rendered.
Here are the relevant files. I included their paths/names in case I am
missing some nuance of the naming conventions.
2006 Mar 28
2
Homepage as index.rhtml, not index.html?
Hi all,
I''m building my first Rails app. Please forgive my ignorance as I get
acquainted with the technology.
What I''d like to do is have a form that the scaffolding created for me
appear on my home page. It''s just one text field, a submit button, and
some error messages.
I first tried to copy the code from the new.rhtml view into the homepage
(index.html), then
2006 Mar 07
4
Controllers More Than One Sub-Directory Deep?
Does anyone know how to make Rails aware of controllers that might
exist in directories that exist deeper than one level under the
app/controllers directory? I initially figured just adding additional
scope information might do the trik (i.e. Tabs::Admin::OneController
or Admin::Tabs::OneController), but that does not seem to work.
I''m guessing that I can just manually add these
2006 May 21
6
Is there a way to call helper methods in a controller?
Hi,
Is there a way to call helper methods in a controller?
I want to do something like this in my controller
Class MyController < Action....
def my_method
string = link_to "some_url", :controller => "home", :action => "command"
end
end
link_to is an ActionView helper method and it seems that I couldn''t access
the method in the controller
2006 Jun 09
4
app at root domain
I have my app up and running at www.domainname.com/controller/ ... but
need to get it set up at just www.domainname.com
I see that by default, rails is loading the pre-made index file in the
/public dir. How can I override this without changing any directories
around in my app?
Thanks!
-stirman
--
Posted via http://www.ruby-forum.com/.