RailsCasts Pro episodes are now free!

Learn more or hide this

Recent Comments

Avatar

I confirm the page parts bug is fixed in 2.0.2. Thanks!

Avatar

Enlightening. Thanks for the post!

Avatar

@ryanb You must be psychic! With unerring regularity you cover topics I'm trying to get my head around. Only yesterday I was experimenting with groups in the gemfile (for using HIRB, WIRB and Awesome Print in the console). Another great, timely episode. Thanks!

Avatar

Awesome tutorial, thanks Ryan!

I am having trouble with constructing price facet for retrieving products. Query facet seems to be the way to go but I have to pre-define all price range in the block which is not good enough as the prices vary considerably for different product types. Has anyone found a finer-grained solution to this problem?

Thanks.

Avatar

After using --binstubs you can add ./bin directory to shell PATH variable.

Avatar

The link to Episode 308: Oh My ZSH is wrong. It points to episode 301.

Have a nice day.

Avatar

"bundler will only fetch the metadata for the gems that it needs, and not every gem known to man"

made me laugh :)

Avatar

Does anyone how what I would do if I have multiple dynamic dropdown in the same form. Say I am allowing someone to pick country state for 3 people at the same time. Is there a way to scope the javascript to look within each person div? Otherwise, the selector would interfere with each other and nothing would work.

Avatar

I've found only this way for routes.rb:

match 'ru/:page_id/:id' => 'subpages#show'

Avatar

Great screencast, Ryan. I have been toying around with Backbone and Ember. I hope you do a screencast on ember. I think it is interesting to contrast the end user development strategies between Ember and Backbone. Both libraries offer similar benefits, but are used in pretty different ways.

I like backbone, but being a Rails guy, I think I prefer the approach Ember takes.

Avatar

Hi,

Thank you for this screencast!

But what if I have Page model

class Page < ActiveRecord::Base
has_many :subpages, :dependent => :destroy

def to_param
mnemoUrl
end
end

And I have Subpage model

class Subpage < ActiveRecord::Base
belongs_to :page
end

How may I use this method for urls like?
http://127.0.0.1:3000/{page_mnemoUrl}/{subpage_mnemoUrl}/

Avatar

I know this is a few weeks old - but this railscast has been as indispensable as the casts on backbone. Thank you for showing me what I needed to use before I even realized it.

Avatar

creating contact pages used to be a bit of a pain, but this makes life much easier

Avatar

for anyone curious, my solution to this problem was to drop the deep_merge approach entirely. Instead of storing all the model information in the session_params, I just created the model in the "first step" then called update_attributes on it in the following steps, effectively "saving" it between steps. This isn't exactly the same behavior shown in this cast, but it's actually better in my case.

Avatar

I believe the ActiveModel::MassAssignmentSecurity module was changed for the release of Rails 3.1.

Now you can do this (in a non-ActiveRecord class):

ruby
include ActiveModel::MassAssignmentSecurity

attr_accessible :first_name, :last_name
attr_accessible :first_name, :last_name, :plan_id, :as => :admin

http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity.html
http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html

Avatar

Joe please post here if the bug Ryan mentioned has been fixed, im about to try Refinary , im just waiting for that fix.

Avatar

Hi,
We are using Spree 1.0.1 for development but getting a lot of issues with lot of extensions.
Even the official plugins Spree Social and Spree Active Shipping has issues, does any one know any alternatives to these above extensions?

Avatar

i was looking into several rails cms a about a year or so ago and none had good documentation. I just checked the new Refinary docs and they are much better than what i remember.

Avatar

The alchemy guide you mentioned is old. Bad that this one is still online, but you can find the actual guide here: http://guides.alchemy-cms.com/creating_modules.html

Since Rails3.1 and mountable engines, this is also implemented.
Alchemy is not only a CMS, its a framework for storing and rendering content.

You first have to understand the architecture behind it, but then its really flexible and comfortable for the user.

Have you ever tried Alchemy?

Avatar

You can relabel the buttons to say anything you want but yes, regardless of our clients' technical skill level, we have trained every single one of them to use the CMS successfully with good, clear documentation and excellent 1-on-1 training sessions, followed by ongoing support if they still have questions. No one has ever, ever had a problem understanding H1, H2, P, etc.

if the client has specific SEO goals, we train them with a style guide of which buttons they should use for what kind of content and heading. It's not hard at all. They get it easily. We also make sure the auto generated markup around their content (this is especially easy with custom engines where they fill in fields more than rich text boxes) is semantic and optimized.

Avatar

For repeatable content you can use refinerycms-copywriting. TinyMCE is garbage. It is better to provide few basic well styled styles like WYMEditor does in RefineryCMS. User can't destroy web with own content easily.

You can disable H1 in WYMEditor easily and force H1 into layout or page partial. You're free to do anything you want with HTML markup.

If basic pages are not enough for you, just generate own engine and customize. Everytime you're working with Refinery code, you're just using yours Rails skills. You don't need more knowledge. Everything is just a Rails engine.

Alchemy is pure CMS. Refinery is more framework than CMS. I'm customizing Refinery (backend and frontend) for each site I'm building. It is very easy to do with Refinery.

You can compare guides:
* plugin for Alchemy
* Refinery engine

The difference is significant. I'm not Alchemy hater. I'm just answering your questions. Feel free to join freenode#refinerycms, if you have another questions about Refinery.

Avatar

the github readmes are also a good source

Avatar

Yes, you are right. You always can use any kind of technique to achieve the same goal.
You could do this even with wordpress, for sure.

But does your customer has a technical background? Does he know what a 'p' is and what this means? Ours have not, and they should not, IMHO. How do you prevent failures in markup? Especially in SEO concerns? Alchemy decouples the markup 100% from styling and content. So a heading is always a H1 tag (or what ever the webdev wants it to be). The user does not even has the chance to change that and is save from making errors. And they love Alchemy for that!

How do you ensure this with refinery? Do you wrote tinymce plugins, not really? And how do you manage repeatable, global content, like teaser boxes, footer parts, etc. And what does this mean for your developers? It is easy and intuitive to implement?

I think it is always a question of perspective.

You really should give Alchemy a try for your next project.

I am sure you will love it :)

Regards

Avatar

There is also an active IRC channel #refinerycms at irc.freenode.net but yes the guides need work. They are outdated and could use some organization to be sure. The core team and friends are gearing up to dedicate some time to it, especially in light of being featured on Railscasts

Avatar

With the right combination of engines and development techniques, it's possible to give clients complicated and well-layed-out web sites. I think we've demonstrated that here http://www.neotericdesign.com/portfolio and our own site is in Refinery.

Avatar

Right, Robin.

If anyone is interested in an extremely flexible rails cms, that completely separates content, markup and styling, then you really should try Alchemy CMS.

Do you really want to give your customers a TinyMCE editor, where he has to put images into markup? I doubt that! Refinery and all other "Page model, body column" cms are great if you need a small little cms addon for your own rails app and you, as a developer, manages the content for your customer.

But if you want to let your customer manage a whole webpage with several different page layouts and page elements you won't make him happy with such a cms.

Please try Alchemy :)

Avatar

All these CMS (with a page model and a body column) out there are missing one big thing:
A flexible content storing architecture.

I would never give one big editor for managing the texts, formattings, images to my client. The client always breaks the layout, because of too many possibilities.
Take a look at http://alchemy-cms.com - its architecture is completly different and the usage is enduser-centric ;-)

Avatar

I'm trying to use Guard (to execute rspec) for my new project (Rails 3.2 even if I think it does matter), but I cannot start it properly. I have all the required gems and dependencies installed but when I run bundle exec guard, it runs all the specs once and after I get dyld: unknown required load command 0x80000022 and it exits.
My machine is running MAC 10.5.8

Any ideas how to solve my issue?

Thanks for any help.

Avatar

Hey Ryan, yet another amazing rail-cast. I have learned loads abt ruby and rails just following the videos here. Currently using nested_form gem works wonderfully, but prototype seems to have a conflict with jQuery, any help regarding that would be helpful. Thank you.

Avatar

Thanks for the screencast. We have been using refinerycms extensively and really like it a lot. Now that the new version is out it seems time to check it out.

Avatar

Hi Charly, Thank you for this comment, I know you posted this almost a year a go, but just one question, do you still remember how can we use that module, the article just post the module, but there are no instructions about it. Do you have the any idea about how? Thank you very much

Avatar

woaaa you made a very good screencast, thanks ;)

Avatar

yes, but not out of the box. there are no CLI args to generate bootstrap layout or use it as core's stylesheet. it's clear how to override your own views using bootstrap, but not the whole cms. for me as newbie it takes a lot of time to understand how it works.. also, you can not extrac refinery gem sources to vendor/ for convinience.

Avatar

it's fair and superficially. just for getting started.

Avatar

I guess this means we've finally hit the big time. Not that I'm apart of the team, but I've been following this project for quite some time now and its good to see it mentioned here by Ryan.

Avatar

I tried Refinary a long time ago but there is no good documentation, it must have taken you quite some time digging through the source code to figure all this out ryan

Avatar

Is Refinery compatible with Twitter Bootstrap?

Avatar

I don't think it's as much of a convention as it is a convenience. There's no harm in appending :string when running the generator.

Avatar

It is all fine until you try to integrate it as a part of existing app. I'm working on it at the moment for a while.

Avatar

Here's a blog post I wrote on writing RSpec test cases for Stalker
Testing Stalker (Beanstalkd) Jobs With RSpec In Rails

Please send over any feedback.

Avatar

please, cast-pro about refinery!!! awesome and dynamic project, but it has no any guides or structural documentation.

Avatar

Rails 3.2 migration conventions work, as well. String is default

rails g refinery:engine piano name dimensions manufactured_on:date upright:boolean photo:image description:text

Avatar

is there any gem to use it with rails 3.0 ? rails pre-asset-pipeline ? I don't want to upgrade to rails 3.1 and looking for gem rather than to do it manually , any ideas ?

Avatar

Thanks for the great screencasts, Ryan! I found your explanations very helpful.

I am having a bit of a problem with a slightly more complicated variation of what you did for the Raffler application. I am trying to make a small "one-page" blog application, where posts can be commented. So far, I can fetch comments in a Collection, but I find it difficult to understand the strategy when to fetch, and how to update the posts index view when new comments were made.

I tried a first project template here: https://github.com/mulderp/backbone_testapp

Thanks for sharing some thoughts or feedback, if possible!
I would also be curious on thoughts how to do this TDD if possible...

Avatar

another issue is, now that the oauth info is in the cookie, it is only erased if the an account is created

since no one logged in yet, it still says logged out, so the user may leave the computer physically, and if a stranger decides to create an account, since it says logged out, that person will add your oauth to his email account.

after checkout out other websites like path.com and quora.com, it seems there is only two ways to do it correctly.

either you have users create and account with a password then link the oauth, path and quora do this

or the other way is you have the oauth itself be the current_user and don't have a user model. many content sites and news sites do this.