I use following codes and tools to debug files of CoffeeScript/JavaScript: Safari browser’s developer tool set breakpoints at debugger tab of javascript files responsive design mode of developer tool can help us to see what a web page is rendered. coffeescript code if myVariable? # this statement can check whether this variable has its value(s), null or undefined. If it has value, this statement would return true, otherwise false. alert
read moreFollow below code for inquiring ones in ActiveRecord between two dates: YourModel.find(:date => somenumber.days.ago..Date.today) # or YourModel.find(:created_at => yourNumber.years.ago..Date.today) # or YourModel.find(:updated_at => yourVariable.months.ago..Date.yesterday) Aboved code are modified from a post at stackoverflow.com. Reference: http://stackoverflow.com/questions/2381718/rails-activerecord-date-between
read moreUse below command to start/restart/stop the postgresql easily: brew services start postgresql brew services restart postgresql brew services stop postgresql Reference: How to start postgreSQL server on mac os x? http://stackoverflow.com/a/24251522/2704360
read moreUse CoffeeScript and JQuery to bind click event at website for getting parameters of a form at URL. In someone.js.coffee file. The following example is modified from reference 1,2,3 and 4 to meet my need. get_parameters_from_url = -> aryParams = {} # Initial an empty object rawVars = window.location.search.substring(1).split("&") #window is used to getting global variables of browsers in coffeescript. location.search is the query string at URL including the question
read moreWanna use functions, which are defined in files of coffeescript language, to change one of CSS attributes such as display when an user clicking a button or element at a web page? You can follow below instructions. At side of web page, for example: Write down a button of HTML 5 for triggering event <button type="button" name="btn-veggie-list" class="btn-veggie-list">Veggie list</button> Target HTML. For example, it’s an unordered list for items in
read moreGrape gem is the core of API service, which bulits API endpoints and handles each exception. Devise gem’s role is the user management system. Doorkeeper gem manages oauth clients, which are related with users in Devise gem, and record oauth clients' app id, secret, scopes, authorization codes and access tokens. Doorkeeper takes responsibilities about giving, revoking, and refreshing authorization codes and access tokens. Wine_bouncer gem’s role is a guard of
read more