I want to do something like this
$.get('/Controller/Action/', { model : null }, function(data) {});
Unfortunatelly it doesn't work. In server side the value of the model is {object}.
How do I get null?
I have authlogic going on my app, but now I need to have an an API. I
don't want to establish a session, just want a user to send in data in
a json request such as:
{"type":"address","password":"mypassword","name":"my notificaiton name
goes here","user":"myusername","text":"my interesting stuff goes
here"}
So questions -
1) is this a decent approach?
2) how do i do the auth inside my rails controller?
the problem is that
1)how can i come to know that the ajax is working properly?.
2)and how can i retrieve this sent data in controller in cakephp?
function checkLength(obj,url){
alert("URL="+url+" OBJ="+obj);
if(obj)
{
var params = 'query='+obj;
var myAjax = new Ajax.Request(url,{method: 'post',parameters:params,onSuccess: loadResponse});
}
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.
If I am loading a view from another NIB, how do I set the File's Owner view property? IB is not letting me hook it up to my View Controller which is loading the external NIB.
My NIB looks like this:
File's Owner - Identity is set to LBRootViewController
First Responder
LBTableViewController - Identity is set to LBTableViewController, NIB Name is LBTableViewController
my urls look like:
www.example.com/{languagecode}/{controller}/{action}/{id}
where language code is en-us, etc.
From the OnActionExecuting event, how can I get these values?
navController is class of UINavigationController, I add it to a view whose controller is uiviewcontroller1:
[uiviewcontroller1.view addSubview:navController.view];
Now, my question is whose is the navController's parentViewController?
(uiviewcontroller1 != navController.parentViewController) is true?
Hi,
Is it possible to pass parameters ($_POST or $_GET) with redirectory helper in Zend Framework? The following code redirect to index action of current controller, but I would like to pass some parameters to it as well.
$this->_helper->redirector("index");
Zend Documenataion does not say anything about it.
Hi
I have view controller, into the view i have put a table view, and a search bar into the table's header... the search bar is not showing up, just the empty table view.
Do i need to do something additional? I'm pretty sure its to do with the view outlet of the UIViewController, set to View...
Thanks
In the app I'm building, I'd like to have a nice footer with data from the database (tags) and a contact-form. All the parts are scripted, but now I'd like to put them all together.
The elements of the footer are the same for every page loaded, only the content is different.
How can I do this, without having to put too much code on every controller?
In an ASP.net MVC 2 app that I have I want to return a 204 No Content response to a post operation. Current my controller method has a void return type, but this sends back a response to the client as 200 OK with a Content-Length header set to 0. How can I make the response into a 204?
[HttpPost]
public void DoSomething(string param)
{
// do some operation with param
// now I wish to return a 204 no content response to the user
// instead of the 200 OK response
}
I want this SQL query to be written in rails controller using find
select id,name from questions where id not in (select question_id from levels_questions where level_id=15)
How will I do this?I am using Rails framework and MySQL db
thanks in advance.
Hi,
Is it possible to JUnit test if wiring by Spring is succesfully?
I would like to do this by reflection. Like: get all beans with id *Controller and test if the fields *services are not null?
Thank you!
Hi,
I am using the code from this tutorial to parse a CSV file and add the contents to a database table. How would I ignore the first line of the CSV file? The controller code is below:
def csv_import
@parsed_file=CSV::Reader.parse(params[:dump][:file])
n = 0
@parsed_file.each do |row|
s = Student.new
s.name = row[0]
s.cid = row[1]
s.year_id = find_year_id_from_year_title(row[2])
if s.save
n = n+1
GC.start if n%50==0
end
flash.now[:message] = "CSV Import Successful, #{n} new students added to the database."
end
redirect_to(students_url)
end
I have a registration form that collects several parameters.
i need to pass all these AND a confirmation code (generated by the controller) to the model for inserting in the DB.
How can I do that?
is there a way to pass the whole post to the model, eg like
$this->model->insert($this->input->form(), $confirmation_code)?
Hey ,Guys!
I want to use the method request.query_string to send the key-value to the controller,how can i use in the sentences;
=link_to 'excel' , reports_excel_path(:format => 'xls',:from => 'conversations')
Thank you!
So I have a product model that looks like
belongs_to :seller
has_many :coupons
And coupon model that looks like
belongs_to :seller
belongs_to :product
And in my Products controller I use
@seller = current_user
@coupon = @seller.coupons.create(params[:coupon])
to create the coupons for the seller
While the coupon is being created, I need to associate it with the product too, i.e When a new coupon is created it should be saved for the seller AS WELL AS for the product.
Hi
My zend framework render function returns:
Warning: include(C:\wamp\www\cms\application\modules\default\views\scripts) [function.include]: failed to open stream: Permission denied...
It's being called in a postDispatch function on the controller, but that doesn't matter as no matter where i put it, it fails.
Any ideas? My view and layout are started in the bootstrap. Thanks
I just started to use Storyboard in Xcode. I have a starting view that has some buttons inside. Is there a way to load a special view when a button is clicked?
I only found this workaround:
-(IBAction)loadRegistration:(id)sender {
// load registration controller
UIStoryboard *storyboard = self.storyboard;
RegisterController *svc = [storyboard instantiateViewControllerWithIdentifier:@"RegisterController"];
[self presentViewController:svc animated:YES completion:nil];
}
i am trying to develop website using zend framework so i had created one index.php file where all my requests goes and c.reated two controller one is IndexController and other is TestController
Class IndexController extends Zend_Controller_Action{
public function indexAction(){
echo "Index Index Jamla";
}
public function displayAction(){
echo "Index Display Jamla";
}
}
now when i access the url http://test/
it correctly calls IndexController and its IndexAction function
but when i access the url http://test/index/index
it displays the message url /index/index was not found on this server same it does when i access http://test/test/index
though http://test/ is equivalent to http://test/index/index
i have a problem in crateing the PHPUnit tests.
where the framework i am using is codeignaitor in addition to doctorin for the ORM
the error it i got is
cannt find class controller
Hi Everyone,
Is it possible to display the created_at date, only if that date matches today's date?
<%=h k.created_at %>
Is this possible? Or should it be done in the controller rather than the view?
Thanks,
Danny
I'm loading a UIViewController into one of my Nav controller's hierarchies, which will contain some text and some images. At the bottom, I will want to create a expandable and collapsable tableview.
First off, is this idea possible? If it is, how do I add it and where do I place the data source and delegate methods?
Can I just make a separate subclass of the TableViewController and then add it to my ViewController as a subview?
I have to make a call to a different url in one of my controllers on my site. The problem is that with all the parameters the other site requires I'm overflowing the url. Is there anyway to call another url from the controller and send all of the parameters using a POST?
I'm not expecting a response from the other site. Also, I think there's a way to do this using the Net::HTTP library thought I'm not sure how.
Thanks
I am trying to block all default methods except create and update in my users controller using declerative_authorization. But at the time I add filter_resource_access or filter_access_to into my usersController i always get "Couldn't find User without an ID". Anyone care to explain why this could be happening?
class UsersController :new
end
end
def show
@user = @current_user
end
def edit
@user = @current_user
end
def update
@user = @current_user # makes our views "cleaner" and more consistent
if @user.update_attributes(params[:user])
flash[:notice] = "Account updated!"
redirect_to account_url
else
render :action = :edit
end
end
end