I have a navigation Controller Class in which i am supposed to use a Tab bar which shows three diffrent Views. I want to show 3 diffrent UIVIew of 3 diffrent classes . How to do this ? Thanks in advance.
Is there any way that I can detect browser type on routing and use specific controller? I want to be able to do something like this in routing.yml:
mobile:
url: /*
requirements:
browser: mobile
What i currently have is the following:
namespace AzureCCCMVC.Controllers
{
[Authorize(Roles="Admin")]
public class AdminController : Controller
{
//Stuff
}
}
what I want to do is have roles for each client such as
Roles { "DEMOAdmin", "GOOGAdmin" , "MSFTAdmin" }
and be able to Authorize The Client name (from URL) and in that role
I know I am doing a horrible job of explaining this... It is possible that I can have users that are users of several clients but only admin's of one ...
I've been looking all over for a simple example of how to have an action (or button) be triggered when the enter key is hit in the text field.
Should I subclass the text field? Would I need to set a delegate to call the action I need? Is there a way to catch the event in my main window controller class?
If you could even just point me to the right direction that would be great. Thanks.
I have the following piece of code in my controller
def index
session[:previous_url] = URI(request.referer).path
if session[:previous_uri] != new_path
redirect_to registration_path(id: current_user.associate_username)
end
end
However this does not actually work and i get a bad URI error.
I just want to check if the request came from a particular page and if not redirect it to another page. I would also like to know if there is a better way for doing this?.Thank you
I have a Class A that when it is instantiated and saved for the first time or modified it will create an instance of Class B and save it also
I want them to be in the same transaction and I want it to be handled in the Model not a controller.
I know how to do this in a conteoller with the ‘transaction do’ block but how do I do it in the model?
Thanks
the cakephp rest tutorial says that post data should be in $this-data, but I am finding that it is not, but instead inside $this-params['form']
However, when using cakephp form helper in a view, the data is in $this-data.
Am I correct to have to check both locations in my controller?
It just seems a bit of a waste of extra code. Shouldnt the data appear in one place for whether it came from a rest rest requestor or Cakephp form post?
ps im using cakephp 1.3
I have an object (Contacts) which has two has_many relationships: Campaign and Company
When I am in the Campaign view, I want to add a Contact.
But without a Company_Id, Controller says cannot find company_id (which needs to be there if I add a Contact through the Company).
What should I do?
Hello,
I have a huge controller in codeigniter, with many functions. I want to limit access to certain functions. How should I proceed?
And can I call the functions using cron daemon???
whats the use of calling a cakephp function
http://localhost/project/controller/method.hello
so whats hello?
but it requires views/method/hello/method.ctp...
Hello people,
I am given a task to convert a crappy(non-secure) hardcoded website into a good one using any good framework.
I have a good idea of PHP.
So can you help me in choosing a framework?
Also, do i need to learn about Model View Controller to use frameworks?
Hello Railers,
I have a simple yield use case and for some unknown reason the default case is never shown:
In my super_admin layout I have:
<%= yield :body_id || 'super_admin_main' %>
My controller
class Superadmin::GolfsController < ApplicationController
layout "super_admin"
def show
end
end
My show view
With or without
<% content_for(:body_id) do %sadmin_golfs<% end %
With: sadmin_golfs is shown.
without: empty string is shown instead of super_admin_main
Can anyone reproduce the same behavior ?
Rails 3
I have a system where a central Java controller launches analysis processes, which may be written in C++, Java, or Python (mostly they are C++). All these processes currently run on the same server. What are you suggestions to
Create a central log to which all processes can write to
What if in the future I push some processes to another server. How can I support distributed logging?
Thanks!
Hey guys
i just have two questions about two methods used in many controllers/servlets in my app:
1-what is the difference between calling a static method in a util class or a non static method (like methods dealing with dates i.e getting current time,converting between timezones), which is better ?
2-what is the difference between calling a method(contain too many logic like sending emails) in the controller directly or running this method in a different thread ?
In MVC, should each model be a globally accessible singleton accessible to any view/controller?
Or should the models be singletons that are dependency injected into any component that requires them?
Or should a new model instance be created for each component that needs one, in which case events would be used to propagate changes across model instances of the same class?
I am about done with an Objective - C Sprite Kit Development course on Lynda, and I wanted to expand on the app the course had me make! It was made so that once I open the app, it started brick breaker, and then there are more classes for additional scenes like Game Over and Restart!
I was wondering if someone could tell me how to make a Main Menu view controller that came before the Brick Breaker screen!
Thanks,
Masen
I'd assume that since the query language sits within the controller (typically) that it belongs to that component, but if I play devil's advocate I'd argue that the query language is execute within the domain of the model, and is tightly coupled to that component so it might also be a part of it.
Anyone know the answer? Is there a straight answer or is it technology specific?
It says , you must use the “set” method to update an entry. Pls help
My model is
$this->db->where('id', $this->uri->segment(3));
$this->db->update('mytable', $data);
My controller is
$data = $this->db->select('mytable', $_POST);
$this->contact_model->model_update_function($data);
The answer to this may be obvious but how do you save an object, in grails, that has a composite id. I have an object that has a composite id including a long and a date and I am trying to save an instance of the object from the update method of another classes controller, and using (object).save() isn't working. Any tips or suggestions?
<Me:FunctionalParFractal runat="server" ID="stockNextDayProg" MinZ=" I LIKE TO BUT it dynamicly" />
I know that i should do it from controller side but i ask, is this possible somehow?
Tnxs
Hi, i would like to create a Rails controller that download a serie of jpg files from the web and directly write them into database as binary
(I am not trying to do an upload form)
Any clue on the way to do that ?
Thank you
Edit :
Here is some code I already wrote using attachment-fu gem :
http = Net::HTTP.new('awebsite', 443)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.start() { |http|
req = Net::HTTP::Get.new("image.jpg")
req.basic_auth login, password
response = http.request(req)
attachment = Attachment.new(:uploaded_data => response.body)
attachement.save
}
And I get an "undefined method `content_type' for #" error
Hi,
if I put a custom class in session, then in an action method I get an instance of that class from session, and populate some fields, I noticed that when a different controller gets that class from session, those fields are populated. Even though after the first call didn't save the updated class back in session.
is this typical behavior for session objects?
I thought I had to use keyword 'static' on the class in session for this to happen
thanks
I am debugging a Spring MVC (3.0) app, deployed on tomcat.
I want to see in my console or log files all the incoming requests. Including 404s, both generated by my app or by spring because it didn't find an appropriate controller. I'd like to see something like this:
GET /index.html
GET /img/logo.png
GET /js/a.js
GET /style/b.css
POST /ajax/dothis?blah=yes
POST /ajax/dothat?foo=np
GET /nextpage.html
...
What is the easiest way to see that.
Hi all
I'm somewhat new to the MVC framework and in accordance with the following post:
NHibernate with StructureMap I am not sure how to actually get the HttpContextScoped ISession in my controller?
I'm sure there is a simple way to do this but I am unsure.
Also, it's a small project and I don't want to go overboard with Enterprise Design Patterns.
Thanks!
Hi,
I am a newbie to Zend framework, I want to know how can we restrict the call to predispatch() function in my controller for any particular action.
-DevD