mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
Created Development tips and tricks (markdown)
parent
a992114898
commit
c2654f29e4
1 changed files with 21 additions and 0 deletions
21
Development-tips-and-tricks.md
Normal file
21
Development-tips-and-tricks.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
This page contains a few tips and tricks that may help you with development on tracks.
|
||||
|
||||
## Clearing cached javascript and css files
|
||||
|
||||
Rails bundles the various javascript and css files into cached files to improve performance. When changes are made to javascript or css files, you need to force Rails to recreate them. This little script deletes those cached files and then touches the restart.txt file to causes the server (at least if you are running passenger) to restart itself the next time tracks runs. If you are running linux, place the code below in a file called tracks.clear.sh or whatever you prefer. The following steps in a terminal should set it up for you. You may substitute your editor of choice for nano and set your own path for the script (I use ~/myscripts).
|
||||
|
||||
mkdir /path/to/myscripts
|
||||
nano /path/to/myscripts/tracks.clear.sh
|
||||
# paste in the code
|
||||
chmod u+x tracks.clear.sh
|
||||
cd ~/bin
|
||||
ln -s /path/to/myscripts/tracks.clear.sh tracks.clear
|
||||
|
||||
Here is the code for the file itself. Change the /path/to/tracks/ path to the path on your server.
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
rm /path/to/tracks/public/javascripts/jquery-cached.js
|
||||
rm /path/to/tracks/public/javascripts/tracks-cached.js
|
||||
rm /path/to/tracks/public/stylesheets/tracks-cached.css
|
||||
touch /path/to/tracks/tmp/restart.txt
|
||||
Loading…
Add table
Add a link
Reference in a new issue