Skip to content
Snippets Groups Projects
Commit 0074aadd authored by ilya's avatar ilya
Browse files

added a select tag to email invitations

parent b4b338b3
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ class ApplicationController < ActionController::Base
end
@aspects = current_user.aspects
@aspects_dropdown_array = current_user.aspects.collect{|x| [x.to_s, x.id]}
@friends = current_user.friends
end
end
......
......@@ -3,8 +3,11 @@
# the COPYRIGHT file.
class InvitationsController < Devise::InvitationsController
def create
begin
params[:aspect_id] = params.delete(:aspects)
self.resource = current_user.invite_user(params[resource_name])
flash[:notice] = I18n.t 'invitations.create.sent'
rescue RuntimeError => e
......
......@@ -4,6 +4,10 @@
%p
= f.label :email
= f.text_field :email
= f.hidden_field :aspect_id, :value => @aspect.id
To
- if @aspect == :all
= f.select(:aspects, @aspects_dropdown_array)
- else
= f.select(:aspects, @aspects_dropdown_array, :selected => [@aspect.to_s, @aspect.id])
%p= f.submit "Send an invitation"
/= link_to "Home", after_sign_in_path_for(resource_name)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment