From d9bd724c1d8c61571a65a79995221b908ecab5b8 Mon Sep 17 00:00:00 2001 From: joshua stein Date: Wed, 19 Sep 2012 12:37:42 -0500 Subject: [PATCH] button_to_function is deprecated --- app/assets/stylesheets/application.css | 4 ++++ app/views/stories/_form.html.erb | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 08853dd..0fbb7f2 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -642,6 +642,10 @@ div#story_preview { div#story_box input#story_url { width: 508px; } +div#story_box button#story_fetch_title { + padding-top: 1px; + padding-bottom: 1px; +} div#story_box input#story_title, div#story_box input#story_moderation_reason { width: 600px; diff --git a/app/views/stories/_form.html.erb b/app/views/stories/_form.html.erb index ef6f886..70e099e 100644 --- a/app/views/stories/_form.html.erb +++ b/app/views/stories/_form.html.erb @@ -10,8 +10,8 @@ <% elsif !f.object.id %> <%= f.label :url, "URL:", :class => "required" %> <%= f.text_field :url, :autocomplete => "off" %> - <%= button_to_function "Fetch Title", - "Lobsters.fetchURLTitle($(this), $('#story_url'), $('#story_title'));" %> + <%= button_tag "Fetch Title", :id => "story_fetch_title", + :type => "button" %> <% end %> @@ -40,3 +40,12 @@ :autocomplete => "off" %> + +