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
# When mounting an action, action will have reference to two urls: :confirm_path and :action_path. | |
routes.rb: | |
namespace: :developer -> | |
business_action Developer::Reject | |
# Renderers (`ConfirmButton` and `Modal`) can access action's :confirm_path and :action_path to render a button or a modal. | |
# As you see, renderers expect an action to have such methods. |
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
# The main rule: I want to see a method call. Brackets are the most simple way to make it. | |
# if there is single argument and it is not a string, brackets required | |
fn() | |
fn(1) | |
fn(variable) | |
# if just single string, quotes are some kind of brackets here, and brackets can be omitted | |
fn 'string' |
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
.posts_list | |
// common styles for all blocks | |
// ... | |
// styles for modified blocks | |
&.for-most_popular | |
background-color: gray | |
.posts_list__title | |
color: green |
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
- # in controller | |
- @posts_most_popular = Post.where('likes_count > ?', 100) | |
- @posts_most_commented = Post.where('comments_count > ?', 20) | |
- @posts_draft = Post.where(status: :draft) | |
- # in view | |
- if @posts_most_popular.any? | |
.posts_list.for-most_popular | |
.posts_list__title Most popular | |
- @posts_most_popular.each_with_index do |post, i| |
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
.blog_post | |
font-size: 12px | |
line-height: 18px | |
.blog_post__title | |
font-size: 20px | |
line-height: 24px | |
.blog_post__meta_data | |
text-align: right |
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
- @posts # we are getting it from controlle | |
- @posts.each do |post| | |
.blog_post | |
.blog_post__title= post.title | |
.blog_post__meta_data | |
.blog_post__date= post.created_at | |
.blog_post__author= post.author.full_name |
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
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p362.tar.gz | |
tar -xvzf ruby-1.9.3-p362.tar.gz | |
cd ruby-1.9.3-p362/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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() { | |
for (var j = 0; j < weekDays; j++) { | |
if (data.weekItem[j].Day == data.weekDays[i].Id) { | |
return true; | |
} | |
}; | |
return false; | |
})() |
NewerOlder