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
// Place your application-specific JavaScript functions and classes here | |
// This file is automatically included by javascript_include_tag :defaults | |
JQuery.ajaxSetup({ | |
'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} | |
}) | |
$(function() { | |
$("a.rjs").click( function() { |
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
// Place your application-specific JavaScript functions and classes here | |
// This file is automatically included by javascript_include_tag :defaults | |
// jQuery.ajaxSetup({ | |
// 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} | |
// }) | |
$(function() { | |
$("a.rjs").click( function() { |
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() { | |
$("a.rjs").click( function() { | |
alert("TEST"); | |
$.ajax({ | |
url: this.href+'.js', | |
dataType: "script", | |
beforeSend: function(xhr) {xhr.setRequestHeader("Accept", "text/javascript");} | |
}); | |
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
$(document).ready(function() { | |
//Click on the link .about, load/append rails/info/properties into .result | |
//And slide the div down to show content | |
//Replacing prototype code, testing/learning purposes | |
$(".about").click(function() { | |
alert("HII"); | |
$.ajax({ | |
type: "GET", | |
url: "rails/info/properties", | |
cache: 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
class Post < ActiveRecord::Base | |
acts_as_taggable_on :tags | |
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
<h1>New post</h1> | |
<% form_for(@post) do |f| %> | |
<%= f.error_messages %> | |
<p> | |
<%= f.label :subject %><br /> | |
<%= f.text_field :subject %> | |
</p> | |
<p> |
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 BlogPost < ActiveRecord::Base | |
has_many :comments | |
acts_as_taggable_on :tag, :tag_date | |
validates_presence_of :subject, :content, :tag_list | |
def after_save | |
self.tag_date_list = self.created_at.split("-")[0..1] | |
end | |
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 BlogPost < ActiveRecord::Base | |
after_save :create_date | |
has_many :comments | |
acts_as_taggable_on :tag, :tag_date | |
validates_presence_of :subject, :content, :tag_list | |
def create_date | |
self.tag_date_list = self.created_at.split("-")[0..1].join(" ").to_s | |
self.save |
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 BlogPost < ActiveRecord::Base | |
has_many :comments | |
acts_as_taggable_on :tag, :tag_date | |
validates_presence_of :subject, :content, :tag_list | |
after_create :create_date | |
def create_date | |
self.tag_date_list = self.created_at.split("-")[0..1].join(" ").to_s | |
self.save |
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 BlogPost < ActiveRecord::Base | |
has_many :comments | |
acts_as_taggable_on :tag_cat, :tag_date | |
validates_presence_of :subject, :content, :tag_cat_list | |
after_create :create_date | |
def create_date | |
self.tag_date_list = self.created_at.strftime('%Y %m') | |
self.save |