Good code?


Could you look at some code I created? I don't know if it's good... or
if it could be better.
Especially the controller. I couldn't find a way to let the
declaration_payers be automatically saved.

  def create
    @declaration =[:declaration])

      @users = User.find(:all)
      render :action => 'new'
      return false

    @declarations_payers = params[:declarations_payers]
    @additional_persons = params[:additional_persons]

    #If there are payers, add them
    if @declarations_payers
      @declarations_payers.each_value { |user_id|

        #Add new object
        @declarations_payer =

        #Set user_id variable (from post)
        @declarations_payer.user_id = user_id

        #Add aditional persons (from post)
        @declarations_payer.additional_persons =

        #Add the object to the declaration object
        @declaration.declarations_payers << @declarations_payer

    flash[:notice] = 'Declaration was successfully created.'
    redirect_to :action => 'list'


<%= error_messages_for 'declaration' %>

<p><label for="declaration_amount">Amount</label><br/>
<%= text_field 'declaration', 'amount' %></p>

<p><label for="declaration_description">Description</label><br/>
<%= text_field 'declaration', 'description' %></p>

<% unless @users.nil? %>
  <% for user in @users %>
    <label for ="<%= 'user_ids['']' %>"><%=
user.fullname %></label>

    <%= check_box_tag 'declarations_payers['']',, @declaration.users.include?(user) %>
    <%= text_field_tag 'additional_persons['']',
@declaration_payers[], 'size' => 1 %>

    additionele personen
    <br />
  <% end %>
<% end %>


Thanks in advance!