Profile cover photo
Profile photo
James Tt
James's posts

Post has attachment
setting up automatic deployment via git
If you wish to have automatic deployment with rails and thin, here is an example: 1st, clone your repository on server to a path. Next, vi .git/hooks/post-merge add in your bash script to run after git is pull example: bash -lc /pathtoroot/ chmod a...

Post has attachment
beego bee tool migration error?
beego default migration tool does not show any error, its very annoying. here is a fix, clone this repository instead, and goto $gopath cd run: go build go install and now, rerun your bee migrate

Post has attachment
rails 5 hstore hash
Rails 5 now returns params as a class instance, no longer a hash. due to the requirement to have random hashs key based on user input, the only way to do this is to force this value by calling .to_unsafe_h example: res = params.require(:detail).permit(:name...

Post has attachment
speed up rails development
One of the main concern with rails development is the speed. its very slow indeed when your stack grows. I found several reasons for it to be slow: assets , when debug is enabled, each individual js and css file will be loaded individually navigation menu w...

Post has attachment
turbolinks 5 and ckeditor
turbolinks 5 gives some pretty neat features. it no longer needs turbolinks-jquery. but in some way, it doesnt work properly due to cache within turbolinks. a work around this issue would be calling: #coffeescripts: jQuery(document).on('turbolinks:load', (e...

Post has attachment
rails local assets precompile
if you have spring, you may not run bin/rake or bin/rails assets:precompile. here is a way todo it right RAILS_ENV=production bundle exec rake assets:precompile ensure that you have (config/application.rb) set config.assets.initialize_on_precompile = false ...

Post has attachment
gem install mysql -v 0.3
ive issues with rails 4.1 that it does not play well with mysql2 v 0.4 . im forced to use mysql2 v 0.3.20 when i ran gem install mysql -v 0.3.20 i can to this error: errmsg.h is missing ive already have mysql-dev installed. after searching around, i found t...

Post has attachment
rails admin date time input format
after upgrading to rails admin 0.8.1, took me few hours trying to figure why all my datetime input fail to work. it turned out that rails admin have forced their datetime input format based on en.time.formats.long this can be set in en.yml for more formats:...

Post has attachment
capistrano slow, alternative: blazing
capistrano seems to be quite slow to deploy.
it works great for production, as it export entire git into independent directory and relink directory from shared directory. my work around is using blazing. since blazing 0.5, recipes is no longer supported. bl...

Post has attachment
undefined method `register_preprocessor' for nil:NilClass
seems to occur on sprocket-rails v3.0

sprockets-rails (2.3.3) works great!
sprocketrails 2.3.3 + sprockets (3.5.2)

sadly the issue was closed
Wait while more posts are being loaded