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
<h1>Listing posts</h1> | |
<table> | |
<tr> | |
<th>Name</th> | |
<th>Title</th> | |
<th>Content</th> | |
<th></th> | |
<th></th> | |
<th></th> |
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
<% @posts.each do |post| %> | |
<tr> | |
<td><%= post.name %></td> | |
<td><%= post.title %></td> | |
<td><%= post.content %></td> | |
<td><%= link_to 'Show', post %></td> | |
<td><%= link_to 'Edit', edit_post_path(post) %></td> | |
<td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' }, :remote => true, :class => 'delete_post' %></td> | |
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
$(function(){ | |
$('.delete_post').bind('ajax:success', function() { | |
$(this).closest('tr').fadeOut(); | |
}); | |
$("#form").submit(function() { | |
$post($(this).attr("action") + '.js', $(this).serialize(), null, "script"); | |
return false; | |
}); |
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
// This is a manifest file that'll be compiled into application.js, which will include all the files | |
// listed below. | |
// | |
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | |
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | |
// | |
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | |
// the compiled file. | |
// | |
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
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
$('.x').append('<%= escape_javascript(render :partial => "contacts/contact_card") %>'); | |
$('.field-clear').val(''); | |
$.colorbox.close(); | |
$(".contact-card:even").addClass("pull-left"); | |
$(".contact-card:odd").addClass("pull-right"); |
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
<div class="content pull-left"> | |
<h2><%= @company.name %></h2> | |
<%= link_to "edit company", edit_company_path %> | |
<div class="margin-bottom"> | |
<% for phone in @company.phone_numbers %> | |
<li><%= phone.number %> (<%= phone.place %>)</li> | |
<% end %> | |
</div> | |
<ul class="nav nav-tabs margin-top" id="company-tab"> |
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
$('.deals-wrapper').append('<%= escape_javascript(render :partial => "deals/deal") %>'); | |
$(':input') | |
.not(':button, :submit') | |
.val(''); | |
$(".deal:even").addClass("background-gray deal-padding"); |
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
$('.deals-wrapper').append('<%= escape_javascript(render :partial => "deals/deal") %>'); | |
$(':input') | |
.not(':button, :submit') | |
.val(''); | |
$(".deal:even").addClass("background-gray deal-padding"); |
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
<div class="container"> | |
<div class="content pull-left"> | |
<%= form_for(@deal, :url => {:action => "create"}) do |f| %> | |
<%= f.label :background %> | |
<%= f.text_area :background, :class => "input-width bottom-border" %> | |
<%= f.label :value %> | |
<%= f.text_field :value, :class => "input-width bottom-border" %> | |
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
<%= form_for [@company, @deal], :remote=> true, :id => "form" do |f| %> | |
<%= f.label :background %> | |
<%= f.text_area :background, :class => "input-width bottom-border" %> | |
<%= f.label :value %> | |
<%= f.text_field :value, :class => "input-width bottom-border" %> | |
<%= f.submit "Add this Deal", class: "btn submit-deals" %> | |
<% end %> |
OlderNewer