sudo su postgresdaha sonra psql ile postgres veritabanına bağlanabilirsiniz.
| = f.select :suburb_town_region_country_id_eq, @countries.map{|country| [country.name, country.id]}, {}, :id => 'country' | |
| = f.select :suburb_town_region_id_eq, @regions.map{|region| [region.name, region.id]}, {}, :id => 'region' | |
| = f.select :suburb_town_id_eq, @towns.map{|town| [town.name, town.id]}, {}, :id => 'town' | |
| = f.select :suburb_id_eq, @suburbs.map{|suburb| [suburb.name, suburb.id]}, {}, :id => 'suburb' |
| %script{:type=>"text/javascript"} | |
| alert("sa") |
| devise_for :users, | |
| :controllers => { :sessions => 'sessions', :registrations => 'registrations'}, | |
| :path => 'accounts', | |
| :path_names => { :sign_in => 'login', :sign_up => 'new', :sign_out => 'logout', :password => 'secret', | |
| :confirmation => 'verification' } |
| str = "Привет" | |
| str.mb_chars.downcase.to_s#=> "привет" |
| module ApplicationHelper | |
| def format_state(state, large = false) | |
| capture_haml do | |
| css_classes = %w(label) | |
| css_classes << state | |
| css_classes << 'large' if large | |
| haml_tag :span, class: css_classes do | |
| haml_concat t("helpers.state.#{state}") | |
| end | |
| end |
| # Use this setup block to configure all options available in SimpleForm. | |
| # File Path: RAILS_ROOT/config/initializers/simple_form_bootstrap.rb | |
| SimpleForm.setup do |config| | |
| config.wrappers :bootstrap, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| | |
| b.use :html5 | |
| b.use :placeholder | |
| b.use :label, class: 'control-label' | |
| b.use :input | |
| b.use :error, wrap_with: { tag: 'span', class: 'help-block' } | |
| b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } |
| if sudo dpkg -s apache2 | grep -q Status; then | |
| echo "Package 'apache2' is installed." | |
| echo "Removin 'apache2'. Please wait..." | |
| service apache2 stop | |
| sudo apt-get -y --purge remove apache2* | |
| else | |
| echo "Package 'apache2' is NOT installed." | |
| fi | |
| if sudo dpkg -s mysql-server | grep -q Status; then |
| # This is a skeleton for testing models including examples of validations, callbacks, | |
| # scopes, instance & class methods, associations, and more. | |
| # Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
| # | |
| # I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
| # so if you have any, please share! | |
| # | |
| # @kyletcarlson | |
| # | |
| # This skeleton also assumes you're using the following gems: |