Skip to content

Instantly share code, notes, and snippets.

@mediasota
mediasota / sitemap.xml
Created November 10, 2015 09:48 — forked from maxivak/readme.md
sitemap.xml for Rails 4 application
# Generate sitemap.xml in Rails app
This post shows how to make sitemap.xml for your web site.
The sitemap will be accessible by URL http://mysite.com/sitemap.xml
# Routes
```ruby
Myrails::Application.routes.draw do
@mediasota
mediasota / rails.history.js
Created February 29, 2016 06:28 — forked from debprado/rails.history.js
Add callbacks to remote links in Rails to manage browser history using pageState and replaceState
function historySupport() {
return !!(window.history && window.history.pushState !== undefined);
}
function pushPageState(state, title, href) {
if (historySupport()) {
history.pushState(state, title, href);
}
}
@mediasota
mediasota / simple_form.rb
Created November 8, 2016 05:46 — forked from gudata/simple_form.rb
simple form initialization for http://materializecss.com/
# Use this setup block to configure all options available in SimpleForm.
# https://github.com/patricklindsay/simple_form-materialize/blob/master/lib/generators/simple_form/materialize/templates/config/initializers/simple_form_materialize.rb
# contribute here: https://github.com/mkhairi/materialize-sass/issues/16
SimpleForm.setup do |config|
config.wrappers :default, class: :input,
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
## Extensions enabled by default
# Any of these extensions can be disabled for a
# given input by passing: `f.input EXTENSION_NAME => false`.