Problem with new action ''validate''

Jose tomas R.
2011-04-17T20:12:23Z

I''ve created a new action in my invitations controller named
validate and validation

controller/invitations_controller.rb

def validate
end

def validation
  @invitation = Invitation.find(params(:key))

  if @invitation != nil
  redirect_to new_client_path, :notice => ''Codigo Aceptado''
  else
  flash.now[:alert] = ''Ingrese un codigo valido''
  render :action => ''validate''
  end
   end

_validation_form.html.erb

<%= form_tag invitations_validate_path do %>

<%= label_tag :key %>
    <%= text_field_tag :key %>


    <%= submit_tag ''validate'', :action =>
''validation'' %>

<% end %>

So when I enter a valid key I get redirected to create a user, but this
isn''t working. the submit isnt doing anything, the :action =>
validation
is not working

config/routes.rb

resources :invitations do
  collection do
    get :validate
    get :validation
  end
end

--
Posted via http://www.ruby-forum.com/.