controller

two databases in one controller cakePHP

I'm having trouble creating a page, which requires two different databases.. The controller is automaticly set to 'DB2', which is also specified in the database config file. When i add a var $uses = array ('groups') to the controller, which is from the other DB (DB1), i get the data from only DB2 and all requests to DB1 become a inval...

Clearly defined Rails routing problem - undefined method for Nil:NilClass

Guys and girls, I have been working on this problem for a while but still no joy. This is my second question within this general area, because the last question was getting too long and this is now more well-defined. Summary of the Problem: I am loading a page for my customers and I get error: undefined method 'name' for Nil:NilClass...

In a CPU all the memory Signals and DATA go through the memoryController, right?

for example: When the MEM CTRLER wants a instruction register to be populated with the DATA which the next ADDR REGISTER points to. Does it send a signal to the ADDR REGISTER to place the next ADDR on the ADDR bus or does the ADDR go to the MEM CTRLER and is placed on the BUS by the MEM CTRLER? ...

dismissing search display controller keyboard

Hi, I am using search display controller and a search bar. When i click inside the serach bar the keyboard appears. When i navigate away to another page , the keyboard does not disappear and stays in the same page. Can you please help me ? Thanks, Andy. ...

In MVC framworks (such as Ruby on Rails), does usually Model spell as singular and controller and view spell as plural?

I usually see Ruby on Rails books using script/generate model Story name:string link:string which is a singular Story, while when it is controller script/generate controller Stories index then the Story now is Stories, which is plural. Is this a standard on Ruby on Rails? Is it true in other MVC frameworks too, like CakePHP, Symf...

How do I test UrlHelper.RouteUrl()?

I'm having a tough go trying to figure out what I need to mock in my tests to show that UrlHelper.RouteUrl() is returning the right URL. It works, but I'd like to have the right test coverage. The meat of the controller method looks like this: var urlHelper = new UrlHelper(ControllerContext.RequestContext); return Json(new BasicJsonMess...

Reading int from a hidden field in .aspx

Hi, I'm struggling to read an int from the hidden field on aspx page. <input type = "hidden" id = "myIntegerId" name = "integerId" value= "<%: Model.MyObjectId %>" runat = "server" /> The value is definately on the form, I can see it in the debugger and print it with <%: %> When I read the form values in the controller, instead of ...

Customizing TabBar in iphone.

Hai Can anyone guide me on How to customize the Tabbar such that each TabBarItem look like rounded button in Tabbar. and how to change the Tabbar Selection color. ...

rails model using class hierarchy from an external gem ?

Hello, I'm working on a project where the data model is : implemented in a separate gem does not use ActiveRecord, nor any relational database storage ( actually it relies on couchdb ) makes usage of namespaces makes intensive usage of class inheritance To simplify the schema, let's say we have the following root class : module ...

Asp.net mvc inheritance controllers

Hi, I'm studing asp.net mvc and in my test project I have some problems with inheritance: In my model I use inheritanse in few entities: public class Employee:Entity { /* few public properties */ } It is the base class. And descendants: public class RecruitmentOfficeEmployee: Employee { public virtual Rec...

cannot access grailsApplication.config.images.location.toString())

Hi, I tried from a controller to use grailsApplication information to create some folder, however, what I got from the following line of code is "false" - my grails application runs well, though.... File(grailsApplication.config.images.location.toString()).mkdirs() could some one help, please? thanks. edit: thank you leebutts for...

Guidelines for calling controller methods in helper modules?

Few questions: Is it possible to call a controller method in a helper module (e.g., application helper)? If so, how does the helper handle the rendering of views? Ignore it? In what instances would you want to call a controller method from a helper? Is it bad practice? Do you have any sample code where you're calling controller method...

MVC - Calling Controller Methods

Hello, My application is following the MVC design pattern. The problem I keep running into is needing to call methods inside a Controller class from outside that Controller class (ex. A View class wants to call a Controller method, or a Manager class wants to call a Controller method). Is calling Controller methods in this way allowed ...

How do you test a command object in a grails controller integration test?

I'm new to grails. How do I test a form command object to make sure that it's working? Here's some setup code in a test. When I try to do it, I get the following exceptions: Error occurred creating command object. org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Error occurred creating command object. ...

mocking command object in grails controller results in hasErrors() return false no matter what! Please help.

I have a controller that uses a command object in a controller action. When mocking this command object in a grails' controller unit test, the hasErrors() method always returns false, even when I am purposefully violating its constraints. The more baffling thing is that in production, hasErrors() works! So this is just a testing problem....

How do I get the action name from a base controller?

Hi, I'd like to implement a base controller on one of my controllers. Within that base controller, I'd like to be able to get the current executing ActionResult name. How would I go about doing this? public class HomeController : ControllerBase { public ActionResult Index() { And; public class ControllerBase : Controller { ...

asp.net mvc - Check what controller and method are called?

How to check what controller and method are called? In html in body tag there is: <body id="somethingThatDependsOnControllerAndMethod">. id value will be assigned based on controller and it's method. ...

How do I pass objects through a _url based on a routing in rails?

I want to pass the attributes associated with two objects into a path created from a route. In this case, the _url is skip_contact_letter_url. contact_letter and letter are passed through a render partial. The clip below resides in the partial. <%= link_to_remote "Skip Letter Remote #{contact_letter}", :url => skip_contact_le...

ASP.NET MVC 2 - ViewData empty after POST

I don't really know where to look for an error... the situation: I have an ASPX view which contains a form and a few input's, and when I click the submit button everything is POST'ed to one of my ASP.NET MVC actions. When I set a breakpoint there, it is hit correctly. When I use FireBug to see what is sent to the action, I correctly see...

Can a grails controller extend from a base class? How to make it so grails doesn't blow up?

I wrote a base class to help build my controllers more quickly and to remove duplication. It provides some helper methods, default actions and some meta programming to make these things easier to build. One of those methods in the base class is like this: def dynamicList(Class clazz) { def model = new LinkedHashMap() model[getM...