Skip to content

Instantly share code, notes, and snippets.

View marinados's full-sized avatar
:shipit:

Marina Starkova marinados

:shipit:
  • Swile
  • Nantes
View GitHub Profile
@francois-blanchard
francois-blanchard / presenters_in_rails.md
Last active April 27, 2016 14:38
Presenters in Rails

Presenters in Rails

Without presenter

View

<h1>@post.title</h1>
<span>@post.publication_status</span>

squash and commit

$ git checkout master
$ git merge --squash release_branch
$ git commit -m 'sprint #42'
$ git log
$ git push origin master
@francois-blanchard
francois-blanchard / scope_no_relation.md
Last active May 12, 2016 08:20
scope for find no relation

scope for find no relation

class User < ActiveRecord::Base
  scope :without_tweet, -> { where.not(id: Tweet.select(:user_id).uniq) }
end

How to Nested

Let's imagine we want to assign pokemons to trainers.

We are creating a new_trainer form with checkboxes for each pokemon and their names next a checkbox to assign them to this new trainer, like this:

  • Salameche