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
## Haml View | |
- fields_for "tests[]", t do |lt| | |
= lt.text_field :name, { :class => "ac"} | |
## JQuery JS | |
$(document).ready( function(){ | |
$('input.ac').autocomplete("/javascripts/search.js"); | |
}); |
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 hello | |
puts "World" | |
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
def test | |
puts "Hello World" | |
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
<div> | |
<%= "Hello World" %> | |
</div> |
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= "Hello World" |
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
### Checking in your Changes to Git | |
git add . | |
git commit -a -m "Your Message Here" | |
### Make sure to pull down the latest changes | |
git pull origin master | |
### Manage any conflicts that may have occurred. | |
### Verify your code functions properly run a db:migrate if data changes were involved | |
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
@people = People.find(:all) do | |
any do | |
if !criteria.numeric? | |
all do | |
first_name =~ criteria.split(' ')[0] + '%' | |
last_name =~ criteria.split(' ')[1] + '%' if criteria.split(' ').length > 1 | |
end | |
all do | |
last_name =~ criteria.split(' ')[0] + '%' | |
first_name =~ criteria.split(' ')[1] + '%' if criteria.split(' ').length > 1 |
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
@people = People.find(:all) do | |
any do | |
if !criteria.numeric? | |
all do | |
first_name =~ criteria.split(' ')[0] + '%' | |
last_name =~ criteria.split(' ')[1] + '%' if criteria.split(' ').length > 1 | |
end | |
all do | |
last_name =~ criteria.split(' ')[0] + '%' | |
first_name =~ criteria.split(' ')[1] + '%' if criteria.split(' ').length > 1 |
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
/* Example: */ | |
$.each([objects], function() { | |
$('tbody').append("<tr><td>" + this.id + "</td><td>" + this.name + "</td></tr>"); | |
}); | |
/* | |
Simple, example, but you can imagine 10 columns or formated "ul"'s could get really ugly and a lot of string manipulation. Also the fact you could easily miss a lt or gt, and not know. | |
So we came up with jTag to make it more readable, and to have javascript handle the lt and gt for us. |
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.write( | |
jTag(function() { | |
h1("Welcome to jTag"); | |
h2("jTag is the new black"); | |
p("It is a new tag library that makes it super easy to create html in js"); | |
ul(function(){ | |
li("Option 1"); | |
li("Option 2"); | |
}); | |
}) |
OlderNewer