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
<!-- _message.html.erb --> | |
<%= @message %> |
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
#new.html.erb | |
<label>Username </label> <span class="string"><%= f.text_field :username %><span id="username_message" class="live_validation"></span></span> | |
<span class="string"><%= observe_field :form_username, | |
:url => { :controller => :live_validations, :action => :validate_username }, | |
:frequency => 0.5, | |
:update => :username_message, | |
:with => "username" %></span> |
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
#new.html.erb | |
<label>Username </label> | |
<%= f.text_field :username %><span id="username_message" class="live_validation"> </span> | |
<%= observe_field :form_username, | |
:url => { :controller => :live_validations, :action => :validate_username }, | |
:frequency => 0.5, | |
:update => :username_message, | |
:with => "username" %> | |
</span> |
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
#new.html.erb | |
<label>Username </label> | |
<%= f.text_field :username %><span id="username_message" class="live_validation"> </span> | |
<%= observe_field :form_username, | |
:url => { :controller => :live_validations, :action => :validate_username }, | |
:frequency => 0.5, | |
:update => :username_message, | |
:with => "username" %> |
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
#application.css | |
.live_validation img { margin-bottom:3px; } |
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.fieldWithErrors').each(function(field) { | |
pageTracker._trackEvent('Form', 'Validation Error', field.down().identify()); | |
}); |
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="fieldWithErrors"> | |
<input id="question_8_street_address" name="question_8[street_address]" type="text" value="" /> | |
</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 class="fieldWithErrors"> | |
<input id="question_8_street_address" name="question_8[street_address]" type="text" value="" /> | |
</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
def search_food(query) | |
base = "http://platform.fatsecret.com/rest/server.api" | |
key = "339df5xx11e42b3e7x3x1b21e7d12" | |
#added the extra & at the end of the secret | |
secret = "215ba9f90c6e4f41b23a149f322d2s7b1&" | |
timestamp = Time.now.to_i | |
signature_method="HMAC-SHA1" | |
nonce = rand(100) | |
method = "food.search" |
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
// model | |
window.Medication = Backbone.Model.extend({ | |
defaults: { | |
"user_id": "1002" | |
}, | |
toJSON : function(){ return { | |
medication_option: _.clone(this.attributes)}; | |
} | |
}); |