On 26 May 2010 20:04, anon_comp <[email protected]> wrote:
> On May 26, 2:41 pm, Colin Law <[email protected]> wrote:
>
>> If the form is not associated with a model then form_tag may be more
>> appropriate.
>
> Going by your suggestion, Colin, my project looks like this
>
> trying_controller.rb:
> class TryingController < ApplicationController
>  def index
>  end
>
>  def to
>   �...@name = params[:title]
>  end
> end
>
> index.html.erb:
> <% form_tag :action => :to %>
> <label for="name">Name:</label>
> <%= text_field_tag :name, params[:name] %>
> <%= submit_tag "OK" %>
> </form>
>
> to.html.erb:
> Name: <%= @name %>
>
> The submit button doesn't work...

In what way does it not work?

Did you check the html to see if it is what you expect?

I think it should be :action = 'to' rather than :to

Also when things are not working as you expect the log file
(log/development.log) can often be useful in analysing the problem.

Colin

-- 
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