Problem in Edit row in plugin

I´m new in ruby on rails. I´ve written a plugin in redmine. And add this plugin to projects tab. I need to show something in that new tab, and edit the data.
But now, I have 2 problems:

  1. In the new tab, when I click on the Edit link, the edit page open in the new page out of projects tab.
  2. In the new page, data get from database correctly and show correctly, but when I want to update data, show the error: Page not found

here is my code:

/config/routes.rb :

get 'accounts', :to => 'accounts#index'
post 'post/:id/edit', :to => 'accounts#edit'
post 'post/:id/update', :to => 'accounts#update'


class AccountsController < ApplicationController
    def index
        @project = Project.find(params[:project_id])
        @accounts = Account.find(:all)

    def edit
        @account = Account.find(params[:id])

    def update
        @account = Account.find(params[:id])
        if @account.update_attributes(params[:account])
           redirect_to :action => 'edit', :id => @account
           redirect_to :action => 'edit', :id => @account



<% @accounst.each do |account| %>
<table border=1px>
<% if account.project.to_s == @project.to_s then %>
<% @id = %>
<td display=inline-block>Project name</td>
<td><%= account.project %></td>
<td display=inline-block>Cost</td>
<td><%= account.cost %></td>
<td display=inline-block>Income</td>
<td><%= account.income %></td>
<td display=inline-block>Factor</td>
<td><%= account.factor%></td>
<% end %>
<% end %>
<%= link_to "Edit", {:action => 'edit', :id => @id } %>


<h1>Editing account </h1>
<%= form_tag :action => 'update', :id => @account do %>

<p><label for="account_cost">Cost</label>:
<%= text_field 'account', 'cost' %></p>

<p><label for="account_factor">Factor</label>:
<%= text_field 'account', 'factor' %></p>

<p><label for="account_income">Income</label>:
<%= text_field 'account', 'income' %></p>

<%= submit_tag "save changes" %>
<% end %>
<%= link_to 'Back', {:action => 'index'} %>

Can anyone help me please?