Last active
April 26, 2018 11:24
-
-
Save mehtaparitosh/6efc8af0539d8174b73670a05bdb8e45 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installing Rails in Ubuntu: | |
https://gorails.com/setup/ubuntu/16.04 | |
Installing atom in rails: | |
http://tipsonubuntu.com/2016/08/05/install-atom-text-editor-ubuntu-16-04/ | |
Adding fields to user devise: | |
http://www.bogotobogo.com/RubyOnRails/RubyOnRails_Devise_Adding_User_Field_and_Customization_Update_Saved.php | |
Replace HTML to HAML | |
https://github.com/dhl/erb2haml | |
AMAZING FORMS (Dog Website/Step by Step Form) | |
https://www.youtube.com/watch?v=d9vMENoqxEE | |
Step by Step Forms | |
https://schneems.com/post/18437886598/wizard-ify-your-rails-controllers-with-wicked | |
Think like a designer | |
https://www.youtube.com/watch?v=RanfCx18gi4 | |
Click to appear, disappear | |
https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_hide_show | |
Rails App with MYSQL | |
https://www.digitalocean.com/community/tutorials/how-to-use-mysql-with-your-ruby-on-rails-application-on-ubuntu-14-04 | |
Setup MYSQL | |
https://www.a2hosting.in/kb/developer-corner/mysql/managing-mysql-databases-and-users-from-the-command-line | |
Build Instagram Clone | |
https://www.devwalks.com/lets-build-instagram-with-ruby-on-rails-part-6-follow-all-the-people/ | |
Securitty For Devise | |
https://github.com/phatworx/devise_security_extension | |
https://github.com/devise-security/devise-security | |
Expire Session, Disallow Back Button to view page after logout, in application controller: | |
before_action :set_cache_buster | |
def set_cache_buster | |
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" | |
response.headers["Pragma"] = "no-cache" | |
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" | |
end | |
Authenticate Admin User to Disallow Downloads in controller | |
def authenticate_admin | |
redirect_to root_path unless current_user.is_admin == true | |
end | |
Change Path and Page of a redirect in routes.rb | |
get '/entries/:id', to: redirect('/entries/submit'), as: 'Submit' | |
Increase Password Complexity of Devise Password | |
validate :password_complexity | |
def password_complexity | |
if password.present? | |
if !password.match(/^(?=.*[a-z])(?=.*[A-Z])/) | |
errors.add :password, "Password complexity requirement not met" | |
end | |
end | |
end | |
Downlaod a PPT Saved Inside The App and change name | |
in routes.rb: | |
get "/entries/download_ppt" | |
and, in Controller: | |
def download_ppt | |
send_file( | |
# Select File To Download | |
"#{Rails.root}/chart-01.pptx", | |
# Change Name | |
filename: "Enterprise Risk - #{Date::MONTHNAMES[Time.now.month]} #{Time.now.year}.pptx", | |
# Add MIME Type | |
type: "application/pptx" | |
) | |
end | |
and, in view: | |
= link_to "Download", entries_download_ppt_path, class: "out" | |
and, in config/initializers/mime_types.rb: | |
Mime::Type.register "application/pptx", :pptx | |
Resize Images | |
https://www.reduceimages.com | |
Deploy Rails App on Ubuntu Server | |
use the rightmost option, allow ssl certificate | |
https://gorails.com/setup/ubuntu/16.04 | |
https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ | |
Convert Image to Icon | |
http://icoconvert.com/ | |
ADDING CUSTOM ERROR PAGES | |
https://medium.com/@tair/custom-error-pages-in-rails-you-re-doing-it-wrong-ba1d20ec31c0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment