This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
class TrackUploader < CarrierWave::Uploader::Base | |
include Sprockets::Helpers::RailsHelper | |
include Sprockets::Helpers::IsolatedHelper | |
include CarrierWaveDirect::Uploader | |
# Recommended for use with fog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filename | |
"#{filename}".underscore | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
class TrackUploader < CarrierWave::Uploader::Base | |
include Sprockets::Helpers::RailsHelper | |
include Sprockets::Helpers::IsolatedHelper | |
include CarrierWaveDirect::Uploader | |
# Recommended for use with fog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SongsController < ApplicationController | |
# GET /songs | |
def index | |
@songs = Song.all | |
@uploader = Song.new.track | |
@uploader.success_action_redirect = new_song_url | |
end | |
# GET /songs/1 | |
def show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= direct_upload_form_for @uploader do |f| %> | |
<p><%= f.file_field :track %></p> | |
<p><%= f.submit "Upload Track" %></p> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Song < ActiveRecord::Base | |
attr_accessible :artist, :artwork, :category, :credits, :title, :track, :year | |
belongs_to :user | |
validates_presence_of :user_id | |
validates_presence_of :title | |
mount_uploader :artwork, ArtworkUploader | |
mount_uploader :track, TrackUploader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="page"> | |
<div class="container"> | |
<div class="row"> | |
<div class="span12"> | |
<h1>News</h1> | |
<hr> | |
<div class="row"> | |
<div class="span8"> | |
<% @news_posts.each do |news_post| %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/vendor/extensions/news_posts/app/views/refinery/news_posts/news_posts/index.html.erb | |
<section id="page"> | |
<div class="container"> | |
<div class="row"> | |
<div class="span12"> | |
<h1>News</h1> | |
<hr> | |
<div class="row"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="carousel"> | |
<div id="myCarousel" class="carousel slide"> | |
<ul class="carousel-inner"> | |
<% @slides.each_with_index do |slide, i| %> | |
<% if i==0 %> | |
<li class="item active"> | |
<% else %> | |
<li class="item"> | |
<% end %> | |
<%= link_to image_fu(slide.image, '1200x490!'), refinery.slides_slide_path(slide) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="carousel"> | |
<div id="myCarousel" class="carousel slide"> | |
<ul class="carousel-inner"> | |
<% @slides.each_with_index do |slide, i| %> | |
<% if i==0 %> | |
<li class="item active"> | |
<% else %> | |
<li class="item"> | |
<% end %> | |
<%= link_to image_fu(slide.image, '1200x490!'), refinery.slides_slide_path(slide) %> |