Permalink
Browse files

make update my RSVP form work

  • Loading branch information...
1 parent b21b9ac commit 31c315f62ac19e616e6f9a24d886d6cc78e29c33 @croaky croaky committed Feb 4, 2011
@@ -1,5 +1,9 @@
class UsersController < ApplicationController
def update
-
+ if current_user.update_attributes(params[:user])
+ render :partial => 'parties/thanks'
+ else
+ render :partial => 'parties/form'
+ end
end
end
@@ -0,0 +1,26 @@
+<section id="registration">
+ <header id="registration-banner">
+ <img src="/images/RSVP-banner.png" alt="registration-banner" width="422" height="145" />
+ </header>
+ <%= semantic_form_for current_user, :remote => true,
+ :html => { :id => "event-registration",
+ 'data-type' => 'html' } do |form| %>
+ <ol class="form">
+ <%= form.input :description, :label => "Tell local students about yourself", :required => true %>
+ <li id="radio">
+ <label>Are you attending the after-party?<abbr title="required">*</abbr></label>
+ <p class="radio developer">
+ <%= form.radio_button :partying, "Partying", :checked => "checked" %>
+ <%= form.label :partying, "Partying", :for => "user_partying_partying" %>
+ </p>
+ <p class="radio designer">
+ <%= form.radio_button :partying, "Not Partying" %>
+ <%= form.label :partying, "Not Partying", :for => "user_partying_not_partying" %>
+ </p>
+ </li>
+ <li id="submit-button">
+ <%= form.submit "Change RSVP", :disable_with => "Please wait..." %>
+ </li>
+ </ol>
+ <% end %>
+</section>
@@ -0,0 +1,3 @@
+<div class="student">
+ <h2>Thanks for RSVPing!</h2>
+</div>
@@ -4,32 +4,7 @@
<section id="main-continue" class="party-main">
<% if current_user %>
- <section id="registration">
- <header id="registration-banner">
- <img src="/images/RSVP-banner.png" alt="registration-banner" width="422" height="145" />
- </header>
- <%= semantic_form_for current_user, :remote => true,
- :html => { :id => "event-registration",
- 'data-type' => 'html' } do |form| %>
- <ol class="form">
- <%= form.input :description, :label => "Tell local students about yourself", :required => true %>
- <li id="radio">
- <label>Are you attending the after-party?<abbr title="required">*</abbr></label>
- <p class="radio developer">
- <%= form.radio_button :partying, "Partying" %>
- <%= form.label :partying, "Partying", :for => "user_partying_partying" %>
- </p>
- <p class="radio designer">
- <%= form.radio_button :partying, "Not Partying" %>
- <%= form.label :partying, "Not Partying", :for => "user_partying_not_partying" %>
- </p>
- </li>
- <li id="submit-button">
- <%= form.submit "Change RSVP", :disable_with => "Please wait..." %>
- </li>
- </ol>
- <% end %>
- </section>
+ <%= render :partial => 'form' %>
<% else %>
<% link_to "/auth/twitter" do %>
<div class="register-button top clearfix">
@@ -9,7 +9,7 @@
<%= registration.role %>, <%= registration.school.name %>
</div>
</div>
- <h2>Thanks for registering! We can't wait to see you!</>
+ <h2>Thanks for registering! We can't wait to see you!</h2>
<h3>Follow @<a href="http://twitter.com/thoughtbot">thoughtbot</a> and @<a href="http://twitter.com/greenhornboston">greenhornboston</a> for updates.</h3>
<h3>We also invite you to join our private <a href="http://groups.google.com/group/developers-developers-developers-developers">mailing list</a> for speakers and attending students.</h3>
</div>
@@ -6,14 +6,6 @@ Feature: A Bostonian parties
Scenario: Bostonian RSVPs for after-party
Given I am on the after-party page
- When I fill in "Full Name" with "Dan Croak"
- And I fill in "Twitter Name" with "Croaky"
- And I fill in "About" with "Developer at thoughtbot"
- And I fill in "URL" with "http://thoughtbot.com"
- And I press "RSVP"
+ When I follow "RSVP via Twitter"
+ And I authenticate my Twitter account
Then I should see "It's only a party if you make it a party. See you there!"
-
- Scenario: Bostonian does not fill in fields on after-party form
- Given I am on the after-party page
- And I press "RSVP"
- Then I should see "can't be blank" on text inputs of the party form
@@ -1,8 +1,7 @@
$(document).ready(function() {
- $("#event-registration")
- .live("ajax:success", function(xhr, data, status) {
- $("#registration").html(data);
- });
+ $("#event-registration").live("ajax:success", function(xhr, data, status) {
+ $("#registration").html(data);
+ });
$('a[href^=#]').bind('click', function(e) {
e.preventDefault(); //prevent the "normal" behaviour which would be a "hard" jump
@@ -15,4 +14,4 @@ $(document).ready(function() {
return false;
});
-});
+});
@@ -948,6 +948,12 @@ ul.ui-menu {
}
.party-main {
- padding-top: 30px;
+ .student {
+ padding: 30px;
+ h2 {
+ font-size: 16px;
+ text-align: center;
+ }
+ }
}
}
Oops, something went wrong.

0 comments on commit 31c315f

Please sign in to comment.