Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthoredu
    Hellow everybody
    I'm new to this forum.
    I don't know why, but, few months ago, I decided to do a internal site with Akelos for one of my clients, but now I'm quite happy with my choice.
    I'm trying to link from one controller to another passing the ID of the first for doing a belongs_to association. All is almost working now, but only one little problem I can't solve.
    I want to pass the parameter trought POST method, after some reading, I tryied this line of code, and other permutations but didn't go,

    return $this->_controller->url_helper->link_to($this->_controller->t($texto), array('controller' => 'valoracion_acts','action' => 'add','demanda_acts_id' => $record->getId() ),array('post'=>true));

    I obtain

    <a href="/sise/valoracion_acts/add/?demanda_acts_id=41" onclick="var f = document.createElement('form'); document.body.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit();return false;">ValoraciĆ³n Salida</a><br/>

    With the parameter passed trought GET method, but I liked to hide the parameter, is possible?

    Hi edu,

    that helper is mainly for avoiding browser accelerators from pre-fetching delete links on your apps. See this and this.

    You might want to create a helper that generates something like this...

    <a href="/sise/valoracion_acts/add/" onclick="var f = document.createElement('form'); document.body.appendChild(f); f.method = 'POST'; f.action = this.href; var i = document.createElement("input"); i.setAttribute("name", 'demanda_acts_id'); i.setAttribute("value", 41); f.appendChild(f); f.submit();return false;">ValoraciĆ³n Salida</a><br/>

    or use a simple form and button/image instead of a link.

    • CommentAuthoredu
    Thank you Bermi, I didn't know anything about pre-fetching and the associated problems...
    And your solution to my problem seems very good, I'll code this helper.