summaryrefslogtreecommitdiff
path: root/public/rails-improvements.html
diff options
context:
space:
mode:
Diffstat (limited to 'public/rails-improvements.html')
-rw-r--r--public/rails-improvements.html63
1 files changed, 50 insertions, 13 deletions
diff --git a/public/rails-improvements.html b/public/rails-improvements.html
index 2b7f527..6a07466 100644
--- a/public/rails-improvements.html
+++ b/public/rails-improvements.html
@@ -2,18 +2,35 @@
<html lang="en">
<head>
<meta charset="utf-8">
- <title>Miscellaneous ways to improve your Rails experience — Luke Shumaker</title>
+ <title>Miscellaneous ways to improve your Rails experience — Luke T. Shumaker</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="assets/style.css">
<link rel="alternate" type="application/atom+xml" href="./index.atom" name="web log entries"/>
</head>
<body>
-<header><a href="/">Luke Shumaker</a> » <a href=/blog>blog</a> » rails-improvements</header>
+<header><a href="/">Luke T. Shumaker</a> » <a href=/blog>blog</a> » rails-improvements</header>
<article>
-<h1 id="miscellaneous-ways-to-improve-your-rails-experience">Miscellaneous ways to improve your Rails experience</h1>
-<p>Recently, I’ve been working on <a href="https://github.com/LukeShu/leaguer">a Rails web application</a>, that’s really the baby of a friend of mine. Anyway, through its development, I’ve come up with a couple things that should make your interactions with Rails more pleasant.</p>
-<h2 id="auto-reload-classes-from-other-directories-than-app">Auto-(re)load classes from other directories than <code>app/</code></h2>
-<p>The development server automatically loads and reloads files from the <code>app/</code> directory, which is extremely nice. However, most web applications are going to involve modules that aren’t in that directory; and editing those files requires re-starting the server for the changes to take effect.</p>
-<p>Adding the following lines to your <a href="https://github.com/LukeShu/leaguer/blob/c846cd71411ec3373a5229cacafe0df6b3673543/config/application.rb#L15"><code>config/application.rb</code></a> will allow it to automatically load and reload files from the <code>lib/</code> directory. You can of course change this to whichever directory/ies you like.</p>
+<h1
+id="miscellaneous-ways-to-improve-your-rails-experience">Miscellaneous
+ways to improve your Rails experience</h1>
+<p>Recently, I’ve been working on <a
+href="https://github.com/LukeShu/leaguer">a Rails web application</a>,
+that’s really the baby of a friend of mine. Anyway, through its
+development, I’ve come up with a couple things that should make your
+interactions with Rails more pleasant.</p>
+<h2
+id="auto-reload-classes-from-other-directories-than-app">Auto-(re)load
+classes from other directories than <code>app/</code></h2>
+<p>The development server automatically loads and reloads files from the
+<code>app/</code> directory, which is extremely nice. However, most web
+applications are going to involve modules that aren’t in that directory;
+and editing those files requires re-starting the server for the changes
+to take effect.</p>
+<p>Adding the following lines to your <a
+href="https://github.com/LukeShu/leaguer/blob/c846cd71411ec3373a5229cacafe0df6b3673543/config/application.rb#L15"><code>config/application.rb</code></a>
+will allow it to automatically load and reload files from the
+<code>lib/</code> directory. You can of course change this to whichever
+directory/ies you like.</p>
<pre><code>module YourApp
class Application &lt; Rails::Application
@@ -22,9 +39,23 @@
end
end</code></pre>
-<h2 id="have-submit_tag-generate-a-button-instead-of-an-input">Have <code>submit_tag</code> generate a button instead of an input</h2>
-<p>In HTML, the <code>&lt;input type=&quot;submit&quot;&gt;</code> tag styles slightly differently than other inputs or buttons. It is impossible to precisely controll the hight via CSS, which makes designing forms a pain. This is particularly noticable if you use Bootstrap 3, and put it next to another button; the submit button will be slightly shorter vertically.</p>
-<p>The obvious fix here is to use <code>&lt;button type=&quot;submit&quot;&gt;</code> instead. The following code will modify the default Rails form helpers to generate a button tag instead of an input tag. Just stick the code in <a href="https://github.com/LukeShu/leaguer/blob/521eae01be1ca3f69b47b3170a0548c3268f4a22/config/initializers/form_improvements.rb"><code>config/initializers/form_improvements.rb</code></a>; it will override <code>ActionView::Hlepers::FormTagHelper#submit_tag</code>. It is mostly the standard definition of the function, except for the last line, which has changed.</p>
+<h2 id="have-submit_tag-generate-a-button-instead-of-an-input">Have
+<code>submit_tag</code> generate a button instead of an input</h2>
+<p>In HTML, the <code>&lt;input type="submit"&gt;</code> tag styles
+slightly differently than other inputs or buttons. It is impossible to
+precisely controll the hight via CSS, which makes designing forms a
+pain. This is particularly noticable if you use Bootstrap 3, and put it
+next to another button; the submit button will be slightly shorter
+vertically.</p>
+<p>The obvious fix here is to use
+<code>&lt;button type="submit"&gt;</code> instead. The following code
+will modify the default Rails form helpers to generate a button tag
+instead of an input tag. Just stick the code in <a
+href="https://github.com/LukeShu/leaguer/blob/521eae01be1ca3f69b47b3170a0548c3268f4a22/config/initializers/form_improvements.rb"><code>config/initializers/form_improvements.rb</code></a>;
+it will override
+<code>ActionView::Hlepers::FormTagHelper#submit_tag</code>. It is mostly
+the standard definition of the function, except for the last line, which
+has changed.</p>
<pre><code># -*- ruby-indent-level: 2; indent-tabs-mode: nil -*-
module ActionView
module Helpers
@@ -56,12 +87,18 @@ module ActionView
end
end
end</code></pre>
-<p>I’ll probably update this page as I tweak other things I don’t like.</p>
+<p>I’ll probably update this page as I tweak other things I don’t
+like.</p>
</article>
<footer>
-<p>The content of this page is Copyright © 2014 <a href="mailto:lukeshu@sbcglobal.net">Luke Shumaker</a>.</p>
-<p>This page is licensed under the <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC BY-SA-3.0</a> license.</p>
+ <aside class="sponsor"><p>I'd love it if you <a class="em"
+ href="/sponsor/">sponsored me</a>. It will allow me to continue
+ <a class="em" href="/imworkingon/">my work</a> on the GNU/Linux
+ ecosystem. Thanks!</p></aside>
+
+<p>The content of this page is Copyright © 2014 <a href="mailto:lukeshu@lukeshu.com">Luke T. Shumaker</a>.</p>
+<p>This page is licensed under the <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a> license.</p>
</footer>
</body>
</html>