On Thu, Jan 12, 2012 at 2:08 PM, Joachim Cheng <[email protected]> wrote:

>
> Ok, I give you the simple code.. Hope you can teach me.. Thank you.
> Where should I place "form_id"??
>
> <%= form_tag action_tasks_path do  %>
>  <table border="1">
>    <tr>
>      <td colspan="3" align="right">
>         <a class='inline' href="#inline_content">[X]</a>
>        <div style='display:none'>
>          <div id='inline_content'>
>             <b>Do you want to save changes made to this job?</b><br/>
>                All details will be lost if you don't save them.
>               <br/><br/>
>                <%= link_to "Don't Save", main_home_path %> |
>               <a href="javascript:parent.$.colorbox.close()">close</a>
> |
>               <%= link_to "save", "#", :remote => true, :onclick =>
> "save_with_click"%>
>           </div>
>        </div>
>      </td>
>    </tr>
>     <script>
>      $(document).ready(function(){
>        $(".inline").colorbox({inline:true, width:"500"});
>      });
>       function save_with_click(){
>        $("#form_id").submit();
>      }
>     </script>
>  </table>
>
>  name: <%= text_field_tag :name, params[:name] %>
>  Description:
>  <%= text_area_tag :description, params[:description], :rows => 3 %>
> <% end %>
>
>

By form_id I meant the ID of the form (you can view that by checking the
source code). I guess it is new_action_tasks, but this is an ID generated
by rails, you can give it a value by sending it like ":id=> my_id" inside
form_tag

I suggest this cast http://railscasts.com/episodes/136-jquery

I might give you an idea of what I'm saying :)

Javier

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to