Class: RsvpsController

Inherits:
BaseController show all
Defined in:
app/controllers/rsvps_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#advertise, #cache_action?, #footer_content, #homepage_features, #plaxo, #rss_site_index, #site_index

Methods included from BaseHelper

#add_friend_link, #ajax_spinner_for, #avatar_for, #block_to_partial, #box, #city_cloud, #clippings_link, #commentable_url, #container_title, #excerpt_with_jump, #flash_class, #forum_page?, #is_current_user_and_featured?, #jumbotron, #last_active, #more_comments_links, #page_title, #paginating_links, #possesive, #profile_completeness, #render_jumbotron, #render_widgets, #rounded, #search_posts_title, #search_user_posts_path, #show_footer_content?, #tag_auto_complete_field, #time_ago_in_words, #time_ago_in_words_or_date, #topnav_tab, #truncate_words, #truncate_words_with_highlight, #widget

Methods included from LocalizedApplication

#get_matching_ui_locale, #get_sorted_langs_from_accept_header, #get_valid_lang_from_accept_header, #set_locale

Methods included from AuthenticatedSystem

#login_by_token, #update_last_seen_at

Instance Method Details

#createObject

POST /rsvps POST /rsvps.xml



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/rsvps_controller.rb', line 24

def create
  @rsvp = @event.rsvps.new(rsvp_params)
  @rsvp.user = current_user
  respond_to do |format|
    if @rsvp.save
      flash[:notice] = :your_rsvp_was_successfully_created.l
      format.html { redirect_to [@event] }
      format.js
    else
      format.html { render :action => "new" }
      format.js        
    end
  end
end

#destroyObject

DELETE /rsvps/1 DELETE /rsvps/1.xml



55
56
57
58
59
60
61
62
63
# File 'app/controllers/rsvps_controller.rb', line 55

def destroy
  @rsvp.destroy
  respond_to do |format|
    format.html { 
      flash[:notice] = :your_rsvp_has_been_retracted.l
      redirect_to [@event]   
      }
  end
end

#editObject

GET /posts/1;edit



19
20
# File 'app/controllers/rsvps_controller.rb', line 19

def edit
end

#find_eventObject



7
8
9
10
11
# File 'app/controllers/rsvps_controller.rb', line 7

def find_event
  @event = Event.find(params[:event_id])
rescue
  redirect_to events_url
end

#newObject

GET /rsvps/new



14
15
16
# File 'app/controllers/rsvps_controller.rb', line 14

def new
  @rsvp = @event.rsvps.new
end

#updateObject

patch /rsvps/1 patch /rsvps/1.xml



41
42
43
44
45
46
47
48
49
50
51
# File 'app/controllers/rsvps_controller.rb', line 41

def update
  @rsvp.attendees_count = rsvp_params[:attendees_count]
  respond_to do |format|
    if @rsvp.save
      flash[:notice] = :your_rsvp_was_successfully_updated.l
      format.html { redirect_to [@event] }
    else
      format.html { render :action => "edit" }  
    end
  end
end