Displaying 20 results from an estimated 1200 matches similar to: "multiple ''render :partial'' in a helper ??"
2006 Jul 06
0
Layouts, Searching/Sorting
Two questions for you all...
1. I have an admin section to a site I''m building. Here''s the pertinent
bit of the layout that all controllers are using:
<div id="main-content">
<%= @content_for_layout %>
</div>
<div id="sidebar">
</div>
I''m using @content_for_layout to display various controller actions such
as new,
2006 Feb 02
5
access controller var within model
I need to access params[:field_name] from within my Model.
@params[:field_name] isn''t working?
2006 Apr 27
3
Routing problem
Hi,
I am having a routing problem and can''t figure out why its happing. I
have added the following line in my routing.rb file.
map.connect ''name/:id'', :controller => ''controller_name'', :action =>
''action_name''
When I use http://domain.com/controller_name/action_name/id then it
works fine on the local machine using webrick
2007 Mar 24
1
RSpec and namespaced controllers
I''m running into a problem with RSpec/Rails and namespaced controllers.
I''ve got a controller called ''TenantsController'' in app/controllers
and another called ''Admin::TenantsController'' in app/controllers/admin
In spec/controllers/, I have a tenants_controller_spec.rb. In
spec/controllers/admin/ I have another tenants_controller_spec.rb.
Both
2007 Oct 23
9
Running rails specs outside of the normal project tree
I want to create a spec/regressions directory with various
regressions (for my rails project). I tried the following:
describe LoginController, "regression for user creation when
steves_sister does not exist", :behavior_type => :controller do
controller_name :login
before :each do
@params = {
"commit"=>"Create Account",
2007 Dec 12
3
undefined method: controller_name
With rspec 1.0.8 I have a spec in the directory:
spec/units/controllers/application_controller_spec.rb
require File.dirname(__FILE__) + ''/../../spec_helper''
class DummyController < ApplicationController
def index
raise "Prevent index from rendering"
end
end
describe ApplicationController, "Handling errors in production",
:behaviour_type =>
2007 Jun 27
2
Controller specs not shareable?
Hi
I just wondered if there was a reason why Rails controller specs are
not shareable? eg
describe "All XHR POSTs to /gap/calculate_quote", :shared => true do
controller_name :gap
# ...
end
describe "XHR POST /gap/calculate_quote with valid details" do
it_should_behave_like "All XHR POSTs to /gap/calculate_quote"
# ...
end
blows up with
2007 Jan 29
2
Cryptic error message when no controller_name
Hi !
In the following spec:
context "A project owner" do
specify "can assign roles to other users" do
# ...
end
end
I get the following cryptic error message:
1)
NoMethodError in ''A project owner can assign roles to other users''
undefined method `session='' for #<Object:0xb741bed4>
2009 Jul 02
7
Params Merge and URL sorting/pagination
Hi all,
Here''s my general setup on the specific template I''m having issues with:
will_paginate for pagination
custom methods for sorting
1-form for team search
1-form for search by date
When searching for a team for instance, the url returned will be:
/rushing_offenses?search=Florida
When searching by date, the url returned will be:
/rushing_offenses?compiled_on=2009-07-02
2006 Jul 09
1
Accessing the name of a controller''s module?
If I''m redirecting to a log in page, and saving the controller and
action name in the session hash, how do I also save the controller
module?
After the log in is completed, I can''t redirect back to the originally
directed page because it''s in a different controller module. For the
controller action name I can use the ActionController instance method
controller_name(),
2006 Jul 26
0
Making methods in application.rb not accessible to the web?
How would I got about making methods in application.rb not accessible to
the web, BUT accessible to my views via the controller object.
I noticed I can do:
controller.controller_name in my views
But I can not do:
whatever.com/controller/controller_name
Making all of the methods in the application.rb protected works, but I
can not accessed them in my views.
Thanks for your help.
--
Posted
2011 Dec 12
0
<%= render_component %> Tag cloud issue for rails version 2.3.11
hi all,
in my application there is tag''s cloud in old code which is load using
following code
<%= render_component :controller => "controller_name", :action =>
"tag_cloud_homepage"%>
now i upgrade the ruby,gem and rails version to
Ruby :1.8.7
Rails :2.3.11
gem :1.6.2
and i am using Windows XP as O.S
my question, now in Rails 2.3.11 "<%=
2007 Mar 21
0
Getting the module name with ObjectSpace...
Hey :)
I''m trying to create a method for making a sitemap dynamically. It
works great for flat sites where you simply have your controllers in
the app/controllers directory. In this case, I can extract the
controller names like,
@controllers
ObjectSpace.subclasses_of(ActionController::Base).each do |obj|
@controllers["#{obj.controller_name}"] = obj
end
However,
2007 Mar 12
1
Can't follow redirects outside current controller - but it's the same controller
Running a functional test on FooController that does
''follow_redirect'', I get ''Can''t follow redirects outside current
controller (from "foo" to "foo"). On further investigation, it turns
out that :foo != ''foo'' around line 401 of actionpack/lib/
action_controller/test_process.rb. Changing the line:
if redirected_controller
2007 Mar 19
0
action_web_services error with rspec_on_rails
I now have two specs in my rails project which correspond to one
rails controller. I can run them individually and they pass, but
running them together (either with the rake task just putting both
files on the command line):
euclid% spec spec/controllers/crud_resource_controller_spec.rb spec/
controllers/crud_resource_controller_with_join_models_spec.rb
2006 Jul 21
0
Getting controller_name from inside an Observer
Hi,
Anyone knows if there is any way to get the controller_name from an external
Observer class?.
Thanks.
2006 Jul 02
3
2 before_filters, only want one to render something
I have two before_filters for a few of my controllers. They are running
my own methods authorize and admin_authorize. authorize is called on
just about every action to make sure that a user is logged in.
admin_authorize is called on about 80% of the actions and is used to
make sure that a user is an administrator. If a user tries to access an
admin_authorize protected action without being
2007 May 08
4
help with rspec''ing controller
Hi,
I''m a rspec newbie. I''m having trouble with rspec''ing a simple
controller to Create a record.
I''ve tried a couple of approaches and still get errors:
Mock ''remedy'' expected :save! with (any args) once, but received it 0
times
-or-
Mock ''Remedy'' received unexpected message :save with (no args).
Here are my two
2007 Mar 19
3
controller_name with dynamic controllers
I''m writing a controller which should only be inherited from,
something like the generic crud controller seen here: http://
geekonomics.blogspot.com/2006/07/crud-and-shared-controllers.html
Now, in my spec, I would like to create a controller which inherits
from the generic CRUDController, without actually creating the
controller. This controller is *only* for testing.
How can I
2006 Jan 03
1
RequireResourceHelper for JS and CSS
The following was posted on my blog at http://blog.inquirylabs.com.
A friend of mine recently expressed interest in this code snippet, so
I thought I''d send it out to anyone else who''s interested. This
module makes it a lot easier to ''require'' javascript and cascading
stylesheet dependencies inside your views or controllers. By