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
0
votes
2 answers
How to call a controller function from a user made library in codeigniter
okay to explain the problem. I have a controller function that is called DeleteBookPage. When this function is called it gets all the data needed for the DeleteBook page. Once on the page the user selects the data they want to delete off their…

user481610
- 3,230
- 4
- 54
- 101
0
votes
1 answer
Setting variables via database query in a Rails controller
I want an admin to be able to view a list of Rides on his dash page, admin_dash#index (which iterates through each variable in a table in the typical fashion).
This is the controller for the admin dash:
class AdminDashController <…

Jennifer Gilbert
- 256
- 2
- 9
0
votes
2 answers
Testing controllers with RSpec: Can't read variables
Having trouble testing variable values from a controller using RSpec.
Relevant controller code:
class ToysController < ApplicationController
def claim
toy = Toy.find(params[:toy_id])
current_user.toys << toy
toy.status = "claimed"
…

ezuk
- 3,096
- 3
- 30
- 41
0
votes
1 answer
Is it a good idea to put content access logic in a BaseController?
I'm developing an ASP.NET MVC application where the content for any page can be pulled from the database, if it exists, and displayed on the page.
This is to make it possible for non-technical persons to edit the content without having to go into…

Jonathan
- 32,202
- 38
- 137
- 208
0
votes
1 answer
How do I use collection_select?
I want to use collection_select, and I've done some research to get it to display the drop down menu with the right Collection of objects and I get to choose a specific object of my choice. But from there I don't know how to pass it.
This is my…

tomato
- 831
- 5
- 15
- 33
0
votes
1 answer
Collection_select problem
UPDATE: Solved. Thanks BusyMark!
EDIT: This is revised based on the answer below from BushyMark. I think I made all the suggested changes correctly, but I still can't get the post_type_id to save to the database when a user submits a message.
My…

MikeH
- 866
- 1
- 14
- 26
0
votes
3 answers
Laravel Routing space in parameters returns 404
I have a action like the following in my controller (home)
public function action_test($keyword)
{
echo $keyword;
}
it works fine when i pass parameter without space like the following
http://localhost/laravel/home/test/apple
but it gives 404…

Mubarak Ali
- 15
- 2
- 6
0
votes
1 answer
MVC confusion, views are not templates
I have been reading an article for many times and yet, I can't still understand some parts.
Link for the article : Model-View-Confusion part 1: Why the model is accessed by the view in MVC
The code below is the one I think I am confused on.
class…

Joey Hipolito
- 3,108
- 11
- 44
- 83
0
votes
2 answers
MVC3 links SEO - how to make calls from one controller to other controller
I have one problem, I am not sure how to explain but I will try.
I followed this: http://www.deliveron.com/blog/post/SEO-Friendly-Routes-with-ASPnet-MVC.aspx
And I was able to achieve what they describe.
But if I have a page where i wish to call…

Diana Dimitrova
- 135
- 2
- 16
0
votes
1 answer
rails custom search page
I'm new to rails, and am trying to create a simple credit card managing application.
I want to have a basic authentication, where the user is presented with a simple form:
4 input fields, each for 4 numbers of the credit card
1 input field for the…

Daniel Estrada
- 926
- 8
- 9
0
votes
1 answer
how to add controllers to swf with flash professional
I've checked on the web for this answer quite deeply with no success. I have flash professional cs5.5 and I've created an animation. I would like that my SWF exported is embedded within to a html of my new website. That is easy configuring publish…

Daniel Ramirez-Escudero
- 3,877
- 13
- 43
- 80
0
votes
1 answer
payroll_items_controller_spec.rb:18:in `block (2 levels) displayed in Rspec Controller code
Below is the controller code in rspec for a master item.
To be very frank I'm very new to Ruby with a little knowledge of coding.
require 'spec_helper'
describe PayrollItemsController , "with valid params" do
before(:each) do
@payroll_item =…

user1705486
- 1
- 1
0
votes
1 answer
default rails nested controller rspec testing
So, I have a controller nested within 2 others
here's an example route
products/123/conditions/321/inventories/121
and the controllers are nested like this as well, so I'm trying to figure out what to stub out in my…

dansch
- 6,059
- 4
- 43
- 59
0
votes
1 answer
rails Do not call before_filter for a specific URL
I am defining a before_filter :authorize_special_user, which checks if the special condition exists or not. If yes, then it is okay, otherwise I redirect to a URL like "/users/special#account". So how do I specify the before_filter to NOT be called…

Rajat
- 1,766
- 2
- 21
- 42
0
votes
2 answers
Codeigniter use more than one controller?
This is more of a non-code related question. I want your experience here and suggestion. I am designing this simple web application where I could just insert data, and then making sure the website will view that data based on categories.
In my…

sys_debug
- 3,883
- 17
- 67
- 98