Topic: Twitter app

Im trying to follow this tutorial: http://www.noupe.com/ajax/a-simple-twit … on.htmlbut the partial _message_form.html.rb uses the old r and wont run on 3.0+, i think it needs changing to form_tag but I cant seem to get it to work.   <% form_remote_tag(:controller =>

Re: Twitter app

Im trying to follow this tutorial: http://www.noupe.com/ajax/a-simple-twit … ation.html

but the partial _message_form.html.rb uses the old r and wont run on 3.0+, i think it needs changing to form_tag but I cant seem to get it to work.

  <% form_remote_tag(:controller => "posts", :action => "create") do %> 
    <%= label_tag(:message, "What are you doing?") %><br /> 
    <%= text_area_tag(:message, nil, :size => "60x2") %><br /> 
    <%= submit_tag("Update") %> 
 
  <% end %>

this returns the error message:

NoMethodError in Posts#index

Showing posts/_message_form.html.erb where line #1 raised:

You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

Extracted source (around line #1):

1:   <% form_remote_tag(:controller => "posts", :action => "create") do %> 
2:     <%= label_tag(:message, "What are you doing?") %><br /> 
3:     <%= text_area_tag(:message, nil, :size => "60x2") %><br /> 
4:     <%= submit_tag("Update") %> 


Thanks in advance.

Re: Twitter app

try

<%= form_for(@posts, :action => "create" %>