Jump Start Rails
Jump Start Rails provides you with a fun and yet practical introduction to Rails, an incredibly popular framework that makes it possible to quickly develop incredibly powerful web applications with Ruby. This short book covers Rails 4, the latest version of the framework, and while it's not intended to be a completely comprehensive Rails guide or an in-depth Ruby tutorial, it will quickly get you up to speed with Rails and give you the confidence to start experimenting on your own.
The book is built around a real-life example project: a personal portfolio site. It's a fun and easily understandable project that is used to demonstrate the concepts outlined in the book in a practical way.
This is a clear, approachable and very easy-to-follow book that will get you to to speed with Rails in no time.
normal. Do a "view source," and you'll see that the long list of resources are now only displayed as one file reference. Pop back into terminal, and you'll see this: I, [2013-05-05T09:00:30.450735 #2688] INFO -- : ↵Processing by PagesController#index as HTML I, [2013-05-05T09:00:30.468154 #2688] INFO -- : ↵Rendered pages/index.html.erb within layouts/pages (1.1ms) I, [2013-05-05T09:00:49.899789 #2688] INFO -- : ↵Rendered shared/_menu.html.erb (0.9ms) ... What you can see here is the asset
the possibilities. Note: A Helping Hand You'll be creating your own helper in the next chapter. However, Rails provides quite a number of helpers for working with assets, forms, dates, numbers etc. The helpers are available to all resources, meaning that you can call them in your controllers and views where you need them. Controlling Fields on the Forms It's possible to edit the way the form fields behave—when creating and editing a resource—in ActiveAdmin too. If we want to add
# include Sprockets::Helpers::IsolatedHelper # Choose what kind of storage to use for this uploader: storage :fog There are a couple of important differences here. First, we've added the call to CarrierWave MimeTypes along with the set_content_type option to make sure that the correct MIME type is set for the image. We've also told CarrierWave that we want to use Fog for storage, meaning that CarrierWave will pass the upload procedure to Fog for sending to S3. You can restart the server now,
Then we can use the Bootstrap styles to create a form, and render our partial:
About Jump Start Rails
clicking the Back link will take you back to the listing of all your posts. Click the Edit link next to the post, and you get taken through to a form where you can change any part of the contents of the post, and then re-save it. Likewise, if you click on the Delete link, you will be prompted first, as shown in Figure 2.12. Figure 2.12. Deleting a post Click OK and the post will be deleted. What we have here is a working application. It's a long way from being complete, of course, but