number = 42 number = -42 if opposite square = (x) -> x * x list = [1, 2, 3, 4, 5] math = root: Math.sqrt square: square cube: (x) -> x * square x race = (winner, runners...) -> print winner, runners alert "I knew it!" if elvis? cubes = (math.cube num for num in list)
match "/posts/:id" => "posts#show" resources :post resources :post, :only => [:index, :show] resources :post do resources :comments end namespace :admin do resources :post end
map.get "posts/:id", "posts#show" map.resources "posts" map.resources "posts", only: ['index', 'show'] map.resources 'post', (post) -> post.resources 'comments' namespace 'admin', (admin) -> admin.resources 'posts'
def show flash[:error] = "Can't find any posts." redirect 'http://www.google.com' #render end
action 'index', -> flash 'error', "Can't find any posts." redirect 'http://www.google.com' render()
link_to('Users index', '/users', {class: 'menu-item'});
form_for(user, {action: path_to.users}, function (form) {
form.label('name', 'Username')
form.input('name')
form.submit('Save')
});
stylesheet_link_tag('reset', 'style')
javascript_include_tag(
'https://some.cdn.com/jquery.min.js',
'application')
/