[Rails] Understanding some concepts

Written By:

Ruby on Rails

Helper method helper_method :current_user The method helper_method is to explicitly share some methods defined in the controller to make them available for the view.


[rails] Log event

Written By:

Ruby on Rails

How can we implement Log function in rails? The demand is get logs every time creating or saving an instance. require 'active_support/concern'module EventLog extend ActiveSupport::Concern include U...


[UI] Dynamic Table - Drag & Drop

Written By:

UI & UX UI Tips

http://jsfiddle.net/will_nguyen/am51zu4L/ https://jsfiddle.net/will_nguyen/qcphos8w/ http://jsfiddle.net/will_nguyen/unmfop22/ http://jsfiddle.net/will_nguyen/qzgqyfgh/ http://jsfiddle.net/will_ng...


[UI] Shift enter textarea

Written By:

UI & UX UI Tips

Listening keypress event, 13 is the enter's code. $('textarea').keypress (e) -> if e.keyCode == 13 && !e.shiftKey mes = $(this).val() send(mes) Reset the textarea, set value is "" $(t...


CSS Best Practices

Written By:

UI & UX UI Tips EXP UI EXP

Using below two classes to make a div center. .vertical-align-middle.center-block


UI Best Practices

Written By:

UI & UX UI Tips EXP UI EXP

Date Field if !$.fn.bootstrapDP and $.fn.datepicker and $.fn.datepicker.noConflict datepicker = $.fn.datepicker.noConflict() $.fn.bootstrapDP = datepicker $('.pickup-date').bootstrapDP 'setDate', n...


Creating bash script

Written By:

MAC OS

1. Firstly, creating a file to contain the script. touch hello 2. Adding these script. #!/bin/bashecho hello work #!/bin/bash to tells the terminal that you are using bash shell 3. Making an execut...


[EXP] How to develop UPDATE function with a UI having appending and removing function

Written By:

UI & UX UI solutions EXP UI EXP BACKEND EXP Problem Solving

UPLOAD Take a look on this article: http://guruonrails.com/multiple-upload-files In UI we will develop append and minus function like this: First loading: Adding hidden field contains document'...


[Rails] Custom Foreign Key

Written By:

Ruby on Rails Rails Best Practices EXP BACKEND EXP

Sometime we need to define a custom name for foreign key for more friendly or something else. class ContainerType < ApplicationRecord has_one :container_mode, foreign_key: 'mode', class_name: 'C...


[SERVER][VPS] Centos management

Written By:

EXP Server Centos

Download from VPS scp root@[IP]:/home/truong/workspace/[FILE] [LOCAL FOLDER] scp root@[IP]:/home/truong/workspace/[FILE] .


Copyright @ 2016 guruonrails