controller

Launching a login view before the tab bar controller is displayed

。_饼干妹妹 提交于 2019-12-03 03:23:33
I have an ios5 app developed using storyboards that currently displays a tab bar controller view on initial launch. I would like to display a login screen before the tab bar controller is displayed. The user would enter his username & password, the system would then authenticate the user and then if successful, display the tab bar controller. I have tried the following 3 options with no luck.. any ideas ? (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Option 1 UITabBarController *tabBarController = (UITabBarController *)self

ExtJS 4.1 Call One Controller From Another

南楼画角 提交于 2019-12-03 03:10:59
Note: I'm a total ignoramus regarding javascript. I've broken my ExtJS 4.1 MVC app out into several controllers like: /app/controller/Auth | |Quiz | |Result | |Blah... |model/... I want to respond to an "event", not a DOM Event , rather a Ext.form.action.Submit.success event by calling functions in both my Auth and Quiz controllers. The summarized code for the first part is here: // File: app/controller/Auth.js attemptLogin : function() { var form = Ext.ComponentQuery.query('#loginpanel')[0].form; if (form.isValid()) { form.submit({ success : function(form, action) { // THIS IS THE FUNCTION

How to push objects in AngularJS between ngRepeat arrays

倾然丶 夕夏残阳落幕 提交于 2019-12-03 03:04:58
问题 So I'm new to AngularJS and I'm trying to build a very simple list app, where I can create an ng-repeat item list and then push a selected item into another ng-repeat list. Although my problem seems to be very simple I wasn't able to find a proper solution yet. So here's the simplified markup: <body ng-app="MyApp"> <div id="MyApp" ng-controller="mainController"> <div id="AddItem"> <h3>Add Item</h3> <input value="1" type="number" placeholder="1" ng-model="itemAmount"> <input value="" type=

asp.net mvc 4 controller execute multiple ajax calls in parallel

耗尽温柔 提交于 2019-12-03 02:52:32
I have an asp.net MVC 4 controller thats methods are called via ajax. The problem is that the ajax requests are handled sequentially by the controller. This causes performance issues as the time to load the page is the sum of all ajax requests and not the longest ajax request. To demonstrate this, I put a break point in the first ("ReadOverview8Week") method. Each of these methods take ~600ms to execute individuality. http://i.stack.imgur.com/HhtEX.png How can I make the controller respond to all three requests in parallel? I am using iis 8. This is the ajax request (from kendo ui dataSource)

Ember.js — How do I target outlets in nested/repeated views, and what are the best practices for such a ui layout?

时光怂恿深爱的人放手 提交于 2019-12-03 02:27:40
问题 I'm working on refactoring an inherited Ember application, with quite a bit of non-mvc disorder to it. I'm looking to keep things as modular as possible, and am hoping to reuse various ui components in multiple screens to help prevent code duplication. It seems like outlets are the best way to do this. Right now, I have a UI displaying a number of elements, each rendered using a templatized view. {{#each item in controller}} {{view App.ItemThumbView}} {{/each}} The right sidebar of this view

How do you use usercontrols in asp.net mvc that display an “island” of data?

*爱你&永不变心* 提交于 2019-12-03 01:32:39
问题 I am trying to find out how to use usercontrols in asp.net mvc. I know how to add a usercontrol to a view and how to pass data to it. What I haven't been able to figure out is how do you do this without having to retrieve and pass the data in every single controller? For example, if I have a user control that displays the most recent posts on several but not all the pages in the site, how do I write the Controllers so that I get data for that usercontrol and pass it to the user control from

Generate a controller with all the RESTful functions

这一生的挚爱 提交于 2019-12-03 01:25:21
问题 I am trying to generate a controller with all the RESTful actions stubbed. I had read at link text that all I needed to do was to use call the generator with just a controller name I would get just that. So, I ran "script/generate rspec_controller Properties" and I got an empty controller. Any other suggestions would be greatly appreciated. 回答1: I don't know about an automated way of doing it, but if you do: script/generate controller your_model_name_in_plural new create update edit destroy

Play framework: How to require login for some actions, but not all

為{幸葍}努か 提交于 2019-12-03 00:38:58
Adding @With(Secure.class) to a controller blocks all unauthenticated access. Is there a way to enabled it only for certain actions, or to except certain actions after it's enabled on a controller? You can't do that with the secure module. As Niels said the secure module is more an example than a solution. You can build your own security system with the @Before annotation. Here is an example: public class Admin extends Controller { @Before(unless={"login", "authenticate", "logout", "otherMethod"}) void checkAccess() { // check the cookie } public void login() { render(); } public void

How to test a Controller Concern in Rails 4

房东的猫 提交于 2019-12-03 00:33:26
问题 What is the best way to handle testing of concerns when used in Rails 4 controllers? Say I have a trivial concern Citations . module Citations extend ActiveSupport::Concern def citations ; end end The expected behavior under test is that any controller which includes this concern would get this citations endpoint. class ConversationController < ActionController::Base include Citations end Simple. ConversationController.new.respond_to? :yelling #=> true But what is the right way to test this

Get controller name in TWIG template

有些话、适合烂在心里 提交于 2019-12-03 00:31:16
I am learning symfony2.3, and I am getting an error when I try to get controller name in twig template. Controller: namespace Acme\AdminBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; class DefaultController extends Controller { public function indexAction($name) { return $this->render('AcmeAdminBundle:Default:index.html.twig', array('name' => $name)); } } In my TWIG template: {% extends '::base.html.twig' %} {% block body %} {{ app.request.get('_template').get('controller') }} Hello {{ name }}!!! {% endblock %} Output: