Controller provides a centralized entry point for handling requests. Usually is referred as a part of Model-View-Controller design pattern.
Questions tagged [controllers]
903 questions
14
votes
2 answers
ASP.NET MVC: Get all controllers
Is it possible to get all controllers available to a ControllerFactory?
What I want to do is get a list of all controller types in application, but in a consistent way.
So that all controllers I get are the same ones default request resolution is…

Andrey Shchekin
- 21,101
- 19
- 94
- 162
14
votes
4 answers
Rendering Partials From One Controller’s View to Another Controller’s View in Rails
I have a view for a controller called "show". Inside that view, i want to render the contents of another controller's view - and obviously, the logic for the form on that view to talk to the controller it belongs too. How do I do this? I am…

Ash
- 24,276
- 34
- 107
- 152
12
votes
6 answers
Multiple Controllers with one Name in ASP.NET MVC 2
I receive the following error when trying to run my ASP.NET MVC application:
The request for 'Account' has found the following matching controllers:
uqs.Controllers.Admin.AccountController
MvcApplication1.Controllers.AccountController
I searched…

loviji
- 12,620
- 17
- 63
- 94
12
votes
3 answers
How to include/inject functions which use $scope into a controller in angularjs?
I am trying to include a library of functions, held in a factory, into a controller.
Similar to questions like this:
Creating common controller functions
My main controller looks like this:
recipeApp.controller('recipeController', function ($scope,…

LazerSharks
- 3,089
- 4
- 42
- 67
12
votes
2 answers
Getting Rails Nested Resources to Route to correct nested Controllers
In Rails 3.2.11, I have the following route definitions
resources :foos do
resources :bars
resources :bangs, :controller => 'foos/bangs'
end
which result in the following routes
foo_bars GET /foos/:foo_id/bars(.:format) …

CITguy
- 198
- 1
- 2
- 9
11
votes
4 answers
LINQ and optional parameters
I'm designing a web service to be consumed by an MVC app (pretty simple stuff), but I need a single method in the web service that takes up to four optional parameters (i.e. catId, brandId, lowestPrice and highestPrice).
How do I write the Linq…

Will Whitehead
- 190
- 1
- 2
- 10
11
votes
1 answer
Magento: How do I get observers to work in an external script?
As far as I can tell, when a script is run outside of Magento, observers are not invoked when an event is fired. Why? How do I fix it?
Below is the original issue that lead me to this question. The issue is that the observer that would apply…

Laizer
- 5,932
- 7
- 46
- 73
11
votes
3 answers
Passing Parameters to sails.js policies
Sails.js (0.9v) controllers have policies defined as:
RabbitController: {
'*': false,
nurture : 'isRabbitMother',
feed : ['isNiceToAnimals', 'hasRabbitFood']
}
is there a way to pass params to these acls eg:
RabbitController:…

Arif
- 315
- 2
- 10
10
votes
2 answers
First Call to a Controller, Constant is defined, Second call, "uninitialized constant Oauth"?
I am trying to get the OAuth gem to work with Rails 3 and I'm running into this weird problem... (independent of the gem, I think I've run into this once before)
I have a controller called "OauthTestController", and a model called "ConsumerToken". …

Lance
- 75,200
- 93
- 289
- 503
9
votes
4 answers
Spring boot and controllers in imported modules
I have a Spring boot application and I want to import a dependency written in spring boot that defines some controllers.
Maybe it is straightforward, but how can I made the main application able to initialize all these controllers in the imported…

mat_boy
- 12,998
- 22
- 72
- 116
9
votes
3 answers
Laravel Cashier Webhook: Get current user
I'm using the following to override the default handleCustomerSubscriptionDeleted method by placing the following in app/Http/Controllers/WebHookController.php:

Zach
- 1,185
- 3
- 24
- 60
9
votes
5 answers
Passing variable from controller to view - Laravel
I'm trying to pass a variable from one view to a controller to another view. I'm not getting any errors, but when it gets to the last view, it doesn't show the variable like it's supposed to. In the first view, I'm just getting a name.
{{…

porcupine92
- 123
- 2
- 2
- 5
9
votes
2 answers
Rails 4 Runtime error in controller: Circular dependency detected while autoloading constant
Let me know if I left anything out. I can't figure out why my views/references/ folder isn't accessible. neither new.html.erb nor index.html.erb is available. When I go to localhost:3000/references my error is:
RuntimeError in…

user3138341
- 219
- 2
- 3
- 12
9
votes
5 answers
How to check if an angularjs controller has been defined
I've got an app defined this way:
angular.module("myApp", [...])
.config(function ($stateProvider, $controllerProvider) {
if (isControllerDefined(controllerName)) {
do_stuff();
}
})
The controllers are defined this…

Sir Robert
- 4,686
- 7
- 41
- 57
8
votes
1 answer
Expect method call and proxy to original method with RSpec
I want to discover with BDD missing :include params for ActiveRecord::Base.find method. So my idea is to have in spec something like this:
ActiveRecord::Base.should_receive(:find).once.and_proxy_to_original_method
parent = SomeClass.find…

BurmajaM
- 724
- 5
- 10