Rails: Trying to separate a model into an engine gem - ruby-on-rails

I'm new to here an to Rails so excuse any dumbness on my part.
I'm trying to do something really simple and can't seen to find a guide that's up to date and properly demonstrates how to do this.
I've written the app described in the official ruby on rails tutorial:
http://edgeguides.rubyonrails.org/getting_started.html
Now I want to take one of the models, say Tags and make a gem out of that. How would I achieve this? I've read some on rails Engines but couldn't really figure out what goes where and mostly what the generators would look like.
I want to be able to write another app now, such as something flickr styled and by adding the new Tags gem to the Gemfile and having a
:has_many tags
In the picture model I've added a tags mechanism to all my pictures.
Any help would be greatly appreciated!

Welcome! Glad you liked the getting started guide, I then shall guide you to the (yet unreleased) engines guide.

Related

Getting more Ruby On Rails Helpers

I am completely new on Ruby On Rails and I already watched a long tutorial to start developing a small web application. In such a tutorial I could see several helpers for textboxes, textareas, dates, times, checkboxes, radiobuttons, comboboxes, and so on.
Where can I find other helpers like accordions, WYSIWYG editors (like an HTML editor), and others that can be bound to data from model and used in views? Maybe a toolbox for example.
I will very much appreciate your feedback.
Best regards.
What you're mostly talking about are Form Helpers. There are a bunch of other Rails Guides so I'd recommend reading through them and getting a better idea of what Rails does and can provide.
If you're not finding what you need in that documentation, you may need to add a 3rd party gem to your app's Gemfile, and follow the gem's documentation for getting it working. The Ruby Toolbox is a good place to start searching if you want to see which gems are most common.
And, of course, in the end you might not be able to find something that someone else already wrote and that solves your problem, in which case you will need to write it yourself. For front-end stuff you'll want to get up to speed on how to use HTML, CSS, and Javascript.

good backadmin gem for a cms

What Im looking is a good background gem for a cms made in Ruby on Rails.
The workflow I had in mind is this.
All articles are divided into categories. So when the user has no made any categories the user cannot enter any articles.
So I need a section for making, updating, deleting categories.
Then I need a way a user chooses a category and then the user can enter a article which will be a part of that category.
Does anyone know a gem which can provide this.
I have tried activeadmin but it looks it cannot do the job,
Roelof
https://www.ruby-toolbox.com/categories/rails_admin_interfaces would be a great place to start looking.
ps. ActiveAdmin probably can do the job, but without seeing the code you've got, we can't help you fix it.
It sounds like you want a blogging app
This one http://fdv.github.com/typo/ seems good. They have a demo, so you can test run it.
refinery Is more like a cms, but there is a demo, so it take 10 secounds to see if it is what you want

Using Phaxio with Rails 3.1 app

I am trying to use the Phaxio API to include the ability to send faxes to customers from my Rails app, however I am having difficulty trying to implement it. I know Phaxio is new and there doesn't seem to be much on it except for what is provided by their online docs, which don't really cover too much and have no examples using rails.
From what I can gather from their docs is that I need to send a request to https://api.phaxio.com/v1/send along with some parameters. In their example they use curl to do this but how would I do this from a rails controller? Is their any helper libraries out there for this or will I have to write it from scratch? I might be swinging in the dark here but any help on this subject matter would be greatly appreciated.
Thanks
I just sent over an email to you, but I'll post some example code here as well. We're currently working on a Ruby helper for Phaxio, but here's some code that should help you get started in the mean time.
You'll need to gem install mime-types first.
http://pastebin.com/jfTLn6Bq
-Josh Nankin
Co-Founder, Phaxio

how do I write a scaffold in rails?

I want to write a rails gem that can scaffold a working prototype of the basic functionality of the gem and I was wondering if anyone can explain the process. I know this is a broad topic but I'm hoping for some pointers to tutorials or other rails docs.
Thanks!
Like most problems I try to solve with rails, there's already a great project that helps you create "starter apps" with rails. Rails Apps helps you create application templates that you can then use to generate starter apps. There are some great examples (i.e. devise + rspec + cucumber) to get you started.

Ruby on Rails Blog

Does anybody know a basic plugin/gem that will allow me to quickly set up a blog in Rails.
I would like it to have a WYSIWYG editor that allows image upload and basic editing.
All the Google results I checked out were tutorials to creating a blog in Rails.
I'm not looking to roll out my own solution, I'm looking for something that was already made, like Wordpress, but for Rails.
Thanks!
Try using Mephisto
PS: Search for "rails blog engine" in Google and you will find many other hits.
Mephisto and typo used to be the mainstream, but there are many new kids on the block these days.

Resources