Class: MusicMetadataEnrichment::GroupsController
Instance Method Summary
collapse
#application_navigation, #navigation_product_name, #navigation_product_path
Instance Method Details
#create ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/music_metadata_enrichment/groups_controller.rb', line 14
def create
build_group
@group.user_id = current_user.id
if @group.save
flash[:notice] = I18n.t('music_metadata_enrichment_groups.create.successful')
redirect_to music_group_path(@group)
else
render :new
end
end
|
#index ⇒ Object
7
8
|
# File 'app/controllers/music_metadata_enrichment/groups_controller.rb', line 7
def index
end
|
#new ⇒ Object
10
11
12
|
# File 'app/controllers/music_metadata_enrichment/groups_controller.rb', line 10
def new
build_group
end
|
#resource ⇒ Object
33
34
35
|
# File 'app/controllers/music_metadata_enrichment/groups_controller.rb', line 33
def resource
@group
end
|
#show ⇒ Object
26
27
28
29
30
31
|
# File 'app/controllers/music_metadata_enrichment/groups_controller.rb', line 26
def show
@group = MusicMetadataEnrichment::Group.find(params[:id])
@membership = @group.memberships.where(user_id: current_user.id).first if user_signed_in?
@year = Time.now.strftime('%Y')
@releases = @group.releases.released_in_year(@year).order('released_at DESC')
end
|