Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jeremie Ges GesJeremie

🏠
Working from home
View GitHub Profile
View heroes.html
<% for hero in @heroes %>
<p><%= hero.name %> is here to help you !</p>
<% end %>
View test.html
<form action="/admin/safety_training_courses" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value=""><input type="hidden" name="_method" value="update"><input type="hidden" name="authenticity_token" value="lk9Fm7n7wZ4dYQ4wyFsgujIwbI5iJrfCgmFT2xYR0IN2zAlYZVJ8HMkUJOvRucX3bEvBku6mXF17DfNUDXljDQ==">
<div class="gray-box">
Industry
<select name="industry" id="industry"><option value="1">Testing</option>
<option value="2">Construction</option>
<option selected="selected" value="3">Development</option></select>
</div>
<div id="subindustries"></div>
<div class="gray-box" data-entry="">
Sub-Industry
View test.haml
- @industries.each_with_index do |industry, index|
- if index == 0
.gray-box
Industry
= select_tag :industry, options_from_collection_for_select(@select_industries, "id", "title", industry[:id])
#subindustries
- else
View ugly.coffee
$(document).ready ->
effect_hide.init()
tabs.init()
if $('#video-slider').length > 0
s = 0
lastMove = 0
View gotham-example-core.coffee
router.match '/users/edit/:id', (params) ->
# Do something awesome here.
View intro.coffee
route.match '/welcome/:user', (params) ->
console.log 'Welcome ' + params.user
View place-holders.coffee
Validator.errors
'in': 'The :attribute must be one of the following types: :values'
'between': 'The :attribute must be between :value1 - :value2'
View validator-rule.coffee
# Single error
Validator.error 'is_batman', 'The :attribute must be batman'
# Bunch of errors
Validator.errors
'is_batman': 'The :attribute must be batman'
'email': 'The :attribute must be a valid email'
View validator-rule.coffee
Validator.rule 'is_batman', (attribute, value, params) ->
if value is 'batman'
return true
return false