Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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
You can’t perform that action at this time.