Render nothing

I want to provide a link in my app to download a new version to install.

I used link_to point to a method in a controller that calls System.app_install, but I want to leave the UI as is. Currently if I don't user render it shows 'undefined'.

Is there a way to call a method in a controller without rendering anything?

p.d.: I know I could do it with ajax but it won't work in blackberry then...

Daniel López Lacalle
Nobody?

Nobody?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gerbrand Stap
If you are not using AJAX,

If you are not using AJAX, you are linking to a new page I guess? So it's logical that you get 'undefined' when there is no page to render.

Probably you could render the same page as where you came from with 'render :action => :thePreviousPage'.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Darryn Campbell
That would work, but it means

That would work, but it means to do processing to render something that is already rendered. What I want is to run some method without doing anything in the UI.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gerbrand Stap
This can only be done using

This can only be done using Ajax calls for as far as I know (but you already figured out that option).

I'm not familiar with developing for BlackBerry, but why aren't Ajax calls possible?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Daniel López Lacalle
I had in mind that ajax was

I had in mind that ajax was not possible for Blackberry 4.6. It seems (non tested) it is possible if the bb has updated software. But not jquery, so you would have to do "difficult" ajax. But well... if there is no other way...

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Evgeny Vovchenko
Only Ajax, Ajax is supported

Only Ajax,

Ajax is supported even on BB 4.6:

http://docs.rhomobile.com/rhodes/device-caps#blackberry-browser-support

Blackberry full browser

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Daniel López Lacalle
I did something like this:<a

I did something like this:

<a href="#" onclick="var r = new XMLHttpRequest();r.open('GET','<%= url_for ,:action => :download_app %>',true);r.send();">Download</a>

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gerbrand Stap
I think you will be better

I think you will be better off using jQuery for Ajax calls. This simplifies your calls and handles a lot of browser specific quirks.

Loading a HTML fragment into a DOM element could for example be done with the following javascript statement:

$( "#element_id" ).load( '<%= url_for :controller => :ControllerName, :action => :ActionName %>' )

Good luck!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Daniel López Lacalle
I'm familiar in ajax with

I'm familiar in ajax with jquery. Is the way I usually do it (this might be in fact the first time I do it without it ). Unfortunatedly old Blackberries have some problems with jquery.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments