Hello all!
I have a multidocument application.
I want to pull data from each of those documents and mirror a subset of the data into a global 'management' HUD window that can sit on another screen.
Do I need a global object of my HudController in each document instance or is there a way I can delegate all the info from the various doc...
Hi,
I'm trying to redirect from one controller to another in Rails and I am getting this error:
undefined method `call' for nil:NilClass
The code is pretty simple (in def create method):
@blog_post_comment = BlogPostComment.new(params[:blog_post_comment])
respond_to do |format|
if @blog_post_comment.save
flash[:notice] = '...
I am new to Ruby and RoR. I am not really understand how the controllers work.
I have an action in ApplicationController
def some_checking
...
end
And I would like to call the action some_checking in another controller
class OtherController < ApplicationController
some_checking
def xxx
end
end
Is there anything wrong? H...
I am using a payment gateway in my rails application, how can i redirect to gateway from my controller and pass all the parameters required by the gateway. basically its a post request.
...
Normally to pass parameters via in RSpec we do:
params[:my_key] = my_value
get :my_method
Where my_method deals with what it received from params. But in my controller I have a method, which takes args directly i.e.:
def my_method(*args)
...
end
How do I call the method with those args from within the test? I've tried get :my_met...
I have a very simple controller set up:
class LibrariesController < ApplicationController
...
def create
@user.libraries << Library.new(params)
@user.save
render :json => "success!"
end
...
end
Basically, whenever I try to access the create method of LibrariesController using HTTParty.post I get a WEBrick::HTTPStat...
Hi, i'm having this issue, in ASP.NET MVC 2 where I'm adding a drop down list on the master page and filling it with data from an abstract master controller. When an option is selected an submit button clicked, it reroutes you to a new page. so lets say
the page lives on http://domain.com/landingPage
i'm on: http://domain.com/landingP...
I have started doing asp.net mvc programming and like it more everyday.
Most of the examples I have seen use separate views for viewing and editing details of a specific entity.
E.g. - table of music albums linking to separate 'detail' and 'update' views
[Action] | Title | Artist
detail, update ...
It's like this, I created a UITableViewCell subclass called NewsItemCell, then I wanna use it in my FirstViewController.m, then I tried to import it, but the compiler keeps telling me this
Below is my code, it is driving me mad, thank you if you can help.
#import "NewsItemCell.h"
#import "FirstViewController.h"
@implementation Firs...
Right now I'm using Controller_Template would like to have RESTful URLs though, is it possible to use both the controllers together somehow? Thanks.
...
I am trying to send a slider value from a controller object to a method of a model object. The later is implemented in the separate file and I have appropriate headers. I think the problem is that I am not sure how to instantiate the receiver in order to produce a working method for the controller.
Here is the controller's method.
-(I...
Simple examples of controllers in a RESTful architecture suggest four actions per controller -- index, create, update, delete -- corresponding with the GET, POST, PUT, and DELETE. But beyond that I still find a dozen little decisions:
Do you have a different controller for resource collections (example.com/things) than you do for an i...
What's the best way to handle exceptions that happen from within a controller's constructor?
All I can think of to do is use Application_OnError() or put a try/catch in my ControllerFactory.
Neither of these solutions seem ideal. Application_OnError is to broad - I have some non-mvc content in the site that has its own error handling.
...
What is the best way to organize status messages ("Your data has been successfully saved/added/deleted") on the Spring MVC-based site using annotation controller?
So, the issue is in the way of sending the message from POST-method in contoller.
...
I'm trying to change the method OnAuthorization, so that it is available for any application ... this way:
public partial class Controller
{
protected override void OnAuthorization(AuthorizationContext filterContext)
{
if ((string)(filterContext.RouteData.Values["action"]) == "test")
{
filterContext.R...
I have several models:
Email
Letter
Call
All three belong to a model Campaign. And a Campaign has_many Contacts
I envision being able to see a schedule for Today by going to domain/schedule/today
What I'd like it to do would be to show all the Events (Email, Letter, Call) that have to happen today for each campaign.
I tried the f...
Hi All,
I'm having a bit of an odd issue. Really too odd to type out, but here goes. Basically I have a controller that refuses to "respond_to" using javascript unless I assign my "chart.generate_xml" to a variable before the "respond_to" block like so:
@xml = @chart.generate_xml(@begin_date,@end_date,1.hour)
respond_to do |forma...
Using the answer Generating the Image from a Controller from this post, I created a controller action to return a chart image as seen below (the X and Y values are just there as test data):
public FileContentResult HistoryChart()
{
Chart chart = new Chart();
string[] currencies = { "ZAR", "USD", "GBP", "JPY" };
...
Hi,
I have set up a navigation controller ( navController ) in Portrait mode to which I push all the viewcontrollers I have. Now when a user switches to Landscape mode, I need to display all the views as a coverflow. For this I use [navController viewControllers] to get all the view controllers in the stack.
In the Landscape view contr...
Pretty Basic one here guys.
I have a View which holds 2 textfields for input and a submit button
<%using (Html.BeginForm("DateRetrival", "Home", FormMethod.Post)){ %>
<%=Html.TextBox("sday")%>
<%=Html.TextBox("eday")%>
<input type="submit" value="ok" id="run"/>
<% }%>
the following controller action which I want to bind the dat...