• Complain

Krzywda - Fearless Refactoring Rails Controllers

Here you can read online Krzywda - Fearless Refactoring Rails Controllers full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2017, publisher: leanpub.com, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Fearless Refactoring Rails Controllers
  • Author:
  • Publisher:
    leanpub.com
  • Genre:
  • Year:
    2017
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Fearless Refactoring Rails Controllers: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Fearless Refactoring Rails Controllers" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Krzywda: author's other books


Who wrote Fearless Refactoring Rails Controllers? Find out the surname, the name of the author of the book and a list of all author's works by series.

Fearless Refactoring Rails Controllers — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Fearless Refactoring Rails Controllers" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Fearless Refactoring Rails Controllers Andrzej Krzywda This book is for sale at - photo 1
Fearless Refactoring
Rails Controllers
Andrzej Krzywda

This book is for sale at http://leanpub.com/railsrefactoringtest

This version was published on 2017-01-26

This is a Leanpub book Leanpub empowers authors and publishers with - photo 2

* * * * *

This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.

* * * * *

2014 - 2017 Andrzej Krzywda

Also by Andrzej Krzywda and Arkency

  • Rails meets React.js
  • Responsible Rails
  • React.js by Example
  • Blogging for busy programmers
  • Developers Oriented Project Management
Rails controllers
What is the problem with Rails controllers?

At the beginning they all start simple, as the one scaffolded with a generator:

1defcreate2@issue=Issue.new(issue_params)34respond_todo|format|5if@issue.save6format.html{redirect_to@issue,notice:Success.}7format.json{renderaction:'show',status::created,location:@issue}8else9format.html{renderaction:'new'}10format.json{renderjson:@issue.errors,status::unprocessable_entity}11end12end13end

For some resources the controllers and actions stay simple. In some of them, though, they start to grow. Its not unusual to see actions like this one:

1classIssuesController<ApplicationController2default_search_scope:issues34before_filter:find_issue,:only=>[:show,:edit,:update]5before_filter:find_issues,:only=>[:bulk_edit,:bulk_update,:destroy]6before_filter:find_project,:only=>[:new,:create,:update_form]7before_filter:authorize,:except=>[:index]8before_filter:find_optional_project,:only=>[:index]9before_filter:check_for_default_issue_status,:only=>[:new,:create]10before_filter:build_new_issue_from_params,:only=>[:new,:create,:update_form]11accept_rss_auth:index,:show12accept_api_auth:index,:show,:create,:update,:destroy1314rescue_fromQuery::StatementInvalid,:with=>:query_statement_invalid1516defbulk_update17@issues.sort!18@copy=params[:copy].present?19attributes=parse_params_for_bulk_issue_attributes(params)2021unsaved_issues=[]22saved_issues=[]2324if@copy&&params[:copy_subtasks].present?25# Descendant issues will be copied with the parent task26# Don't copy them twice27@issues.reject!{|issue|@issues.detect{|other|issue.is_descendant_of?(other)}}28end2930@issues.eachdo|orig_issue|31orig_issue.reload32if@copy33issue=orig_issue.copy({},34:attachments=>params[:copy_attachments].present?,35:subtasks=>params[:copy_subtasks].present?36)37else38issue=orig_issue39end40journal=issue.init_journal(User.current,params[:notes])41issue.safe_attributes=attributes42call_hook(:controller_issues_bulk_edit_before_save
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Fearless Refactoring Rails Controllers»

Look at similar books to Fearless Refactoring Rails Controllers. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Fearless Refactoring Rails Controllers»

Discussion, reviews of the book Fearless Refactoring Rails Controllers and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.