Skip to content

Instantly share code, notes, and snippets.

@sferik
Created March 31, 2011 21:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sferik/897282 to your computer and use it in GitHub Desktop.
Save sferik/897282 to your computer and use it in GitHub Desktop.
<h1>Update status</h1>
<% form_tag '/statuses', :method => :post do %>
<p>
<%= label_tag :text %><br />
<%= text_field_tag :text %><br />
</p>
<p>
<%= submit_tag 'Update' %>
</p>
<% end %>
TwitterExample::Application.routes.draw do
resources :statuses
end
class StatusesController < ApplicationController
before_filter :authenticate
def create
@tweet = Twitter.update(params[:text])
end
private
def authenticate
Twitter.configure do |config|
config.consumer_key = "secret"
config.consumer_secret = "secret"
config.oauth_token = "secret"
config.oauth_token_secret = "secret"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment