Skip to content

Instantly share code, notes, and snippets.

.product
- link = featured_downloads_modal_path(download.id)
- link = modal_path(download.id) if current_user
%a{ :href=>link, :data=>{ :remote=>'true' } }
%img{ :src => download.get_preview_image }/
%h4= download.name
%p= download.description.truncate(120)
%input{:type => "hidden", :value => download.id, :name => "download_id" }/
%input{:type => "submit", :value => "Download", :data => {:remote => true, disable_with: "Please wait..." }, class: 'btn-line' }/
- if @url
@jparrish62
jparrish62 / card.js.jsx
Created January 19, 2017 01:50
I am trying to get all the cards to render out randomly
var Hearts = React.createClass({
getInitialState(){
return { cards: [] }
},
getCards(){
this.setState({
cards: [
{
four: <div className="outline shadow rounded red" onClick={this.flipCard}>
@jparrish62
jparrish62 / _follow.rb
Created August 2, 2016 20:23
First the follow will not render I have replaced the code with text and it works so I know rails is finding the file just not rendering the form second If you look at the _follow_form where I'm calling @post.user_id I' getting a error undefined method user_id for nil nil class
<%= form_for(current_user.active_relationships.build, remote: true) do |f| %>
<div><%= hidden_field_tag :followed_id, user.id %></div>
<%= f.submit 'Follow', class: 'btn btn-primary'%>
<% end %>
require_relative 'fish_menu'
class Customer
attr_accessor :name, :money
include Menu
def inialize(args)
@name = args[:name]