How to create a "guided tour" in Rails app? [closed] - ruby-on-rails

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm looking for ideas, best practices, gems (if such exist) that would allow me to easily create a guided tour for an existing Rails 4 web application.
I would like any new user that signs up to be greeted with a welcome message that explains some of the site's features. When they click "Next", they should go to another page (say, projects list) where another explanatory message appears. Next step would be yet another page (e.g. tasks list) with message and so on... I'd like the explanatory messages to be as unobtrusive as possible, similar to flash messages.
The possibility to skip or hide the guided tour and start it over later would be, of course, very nice to have.
I know that I could create it "by hand" using cookies and some additional controller logic (flash messages) but wouldn't like to pollute all of the controllers with additional logic for guided tour.

I've been using Shepherd.js for the last several months in my Rails apps. I found it handles itself best of all the JavaScript tour libraries in a responsive webapp, as the mobile experience is an important part of our product. Plus, its provided themes were easy to integrate into our existing look-and-feel. (You can install the Shepherd.js rails-assets gem for easier use in the asset pipeline.)
I've since wrapped Shepherd.js into a Rails gem called Abraham to make it easier to configure tour content, track which users have seen each tour, and allow users to skip a tour for now.

Another option is IntroJs http://usablica.github.io/intro.js/, both this and Baldrick's answer are great options.

You could use the jQuery plugin Joyride for this.
I would create a controller dedicated to the guided tour that renders some of your existing views (for example '/tour/1', '/tour/2', 'tour/3', ...), but add inside the hidden html ol used by Joyride (see the doc). At the end of the tour on each page, use the Joyride callback postRideCallback to redirect user to the next page of the tour.

Related

How to document AngularJS + Ruby on Rails app? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm using yard to generate my documentation for Rails apps from an rdoc file. There are AngularJS documentation generators, but how could they be connected to generate one coherent document for an AngularJS + Rails app?
In this case it is probably fine to have them separated, and indeed may make more sense to have them separated. Angular is going to be solely for your client-side stuff, and I'm assuming you're then using Rails as an API or perhaps a different piece of the app's functionality. Either way, they are fundamentally doing different things, so it would make sense to have them in different doc sections.
You could create a "landing page" for your documentation if you'd like: one button links to Angular docs and one to Rails docs, and that would solve the need to have them both "in one place". Actually figuring out a way to make them overlap in the same system is likely not worth the effort though, and may actually be a worse user experience.
As the previous answer stated, it would be good to use two different tools and link them together.
I would start with something like Apipie or just rdoc to document the ruby stuff. Additionally I would search for a good js documentation generator. This article compares a four different generators, while 'Docco' seems to have a ruby port with that is called 'Rocco', that may be even able to generate documentations for both, ruby and js. JSDoc on the other hand enables you to integrate custom pages into your docs (here you could place a link to the apipie generator).
In general I would probably just go for the rails API doc and have some conventions for commenting your angular code, as the angular stuff probably has no API that is accessible by another part of your system and therefore only needs some internal documentation.

Gem to track User Activity [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there a good gem to track/log user activities on the site? Like when they sign in, sign out, or perform an action that changes something on the site (non GET requests in general).
Yes there are. Here is one, paper trail. https://github.com/airblade/paper_trail
Its main prupose is to versioning models but I think its also good for your use case since it registers who made each version.
For more gems search at ruby toolbox. Here are the categoties that you should check in this case
https://www.ruby-toolbox.com/categories/Active_Record_User_Stamping
https://www.ruby-toolbox.com/categories/Active_Record_Versioning
Maybe Userstamp is actually better for your use case.
This is a follow up. I've been using a gem called public_activity. https://github.com/pokonski/public_activity. It's pretty simple to install and setup.
I briefly investigated several similar-purposed gems including: PaperTrail, Vestal versions, audited, Acts as versioned, Userstamp , and found that:
PaperTrail, Vestal versions and Acts as versioned are all very powerful versioning gem. Yes, you can also use it to audit/track users' activities , but it's not very straight forward because they are 'versioning tools', but not for the 'auditing purpose'
Userstamp and audited are for auditing purposing only. but Userstamp is for older Rails versions ( it's a plugin... which is not supported by Rails3(or 3.1, 3.2?) anymore )
so I think 'audited' is a better choice for auditing user activities purpose (not considering model versioning) for Rails3, this is enough for me. Further more, it supports associations and ActiveRecord/MongoMapper.
I hope this helps.
paper_trail is usually used to track changes in object.
If you want to track actions (like a movie, sign in, read a book etc) pfeed
is a good candidate
There is a ruby gem called Action Tracker. I built and use it and it should do exactly what you need (since you use Rails and Devise).
The link is https://github.com/appprova/action_tracker
There are some contribution from outside our core team too (people are using it). You are welcome to try and send feedback!
It depends on why you are looking for those informations. Papertrail or similar can track changes in models easily, see Siwei Shen:s answer for better infos. Also public_ativity type of gems can be used if you are looking on how to make a public feed based on user actions.
Then again if you wan't to do growth hacking or analyze otherwise what are the user flows. It's often easier just to do some custom logging. Create a long text field next to the model and add a line every time something interesting happens. Works well if you wan't occasionally to crunch some data on how users are using the service and how changes in the site affect long term usage.
See https://github.com/holli/referer_tracking for example of this type of approach.

Ruby On Rails CMS inspired by DjangoCMS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I need to choose and customize a Ruby CMS (based on Ruby On Rails preferably) for a couple of pretty large web sites. I know Radiant CMS, Refinery CMS, and Locomotive are the most famous CMS in rails, but none of them include all the features I need. Here are the main non trivial features that are (sometimes) missing in those CMS :
Page main content : Each page main content (each menu item) can display :
A list of articles of a "category" (like a blog)
An individual article extracted from a category
An individual page created with a WYSIMYM editor (this is the basic functionality of RefineryCMS for instance)
Links (external or internal resources in the library, like an uploaded document)
Custom page that require specific development (subscriptions forms,... classic rails controllers)
Template management :
I should be able to reuse "templates" across multiple pages. For instance, a template could be a layout that have a couple of "Placeholders", like one "main placeholder" (that will contains the main content of a page), and a "sidebar placeholder". When an admin build a new page in the admin interface, he should be able to select the template he will use.
The placeholders of a template, just like a page, are editable in the admin (ex: the content of the sidebard). All the pages that use this template get updated of course.
RQ : This template / placeholder feature exists partialy in DjangoCMS
"Plugins" : the content of the placeholders should be filled with custom plugins that I can reuse on multiple templates. For instance, I could code a Twitter plugin that displays the last 10 tweets from a user (a parameter of the plugin). So in the template edit page, I could add this plugin inside the "side placeholder".
This notion of plugin exists for instance in DjangoCMS
WYSIWYM / WYSIWYG editor : in the content of an article or a page created with the WYSIWYM editor, I should be able to
Insert a link to a internal resource form the librairy, for instance a PDF document uploaded previously
Insert internal images form the internal librairy
Insert slide shows of images
Insert videos from Youtube
Multisite : ressources like a list of articles (a categorie of articles), documents, can be displayed on pages of different sites on different domains. Everythings is managed from a simple admin site
Multilingual (articles / pages can be translated)
What would be your choice and why ?
Should I rebuild a custom solution from scratch ?
Did anybody implement one of those features (in Radiant CMS, Refinery CMS, or Locomotive for instance) ?
Thanks for any help or advice on this !
I suggest you give ComfortableMexicanSofa a try. While it may not have every single feature you want, integrating those are pretty trivial.
I'd say there's no CMS with better templating capabilities than Sofa.
Plugins, helpers, partials, snippets... whatever you want to call them can be inserted anywhere.
This CMS comes with Wymeditor for richtext editing. It's not fully integrated yet, so it's not super user-friendly in terms of attaching existing files but I'm working on improving it.
Multisite. Yes, sites can also be attached to a locale. So you can have http://en.example.com and http://fr.example.com
There's also a Wiki that may answer some of your questions.
I'm the author btw. Feel free to ask anything.

Rails: Multi-Step New User Signup Form (FSM?) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I've read the "Create Multi-Step Wizard" in Advanced Rails Recipes. I've also read and re-read the documentation for the updated FSM I'm using called Workflow, and looked here and here. The Advanced Rails Recipe focuses on records (quizzes) that already exist, and doesn't cover creating new ones. The Workflow docs don't cover any code for controllers or views, so I've no idea what to do with all this model magic, and the last two links barely touch on implementation either. From the aforementioned resources, I have a good understanding of what a FSM in Rails is and how to play with it in the console or IRB, but I've got very little direction or understanding how to implement one into my Rails app.
What I would like is this: a simple, multi-step user signup process.
Step 1: User enters in their critical
details (with validations).
Step 2: User enters in their search
criteria, for their profile (with
validations).
Step 3: User agrees to the Terms of
Service (with validations).
Step 4: User is greeted by a
confirmation page, including a link
that takes them to their newly created
account.
I'd also like full navigation between the steps and full capture (saves to the database) with each transition.
Can someone please give me a clear implementation of something similar to this? I would LOVE an example app that includes a multi-step signup process where I can look at the code (FULL source code--models AND controllers and views) under the hood, but I've been unable to find anything like that.
Any guidance would be appreciated!
2020: How to do multi-step forms in Rails
TLDR; You create custom controllers that are just for the wizard flow that are separate from the normal created controllers and further you utilise ActiveModel to do validations along the way without needing to save to the database until the end.

Anyone got SEO tips for Ruby on Rails [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Can anyone recommend some RoR plugins and/or general sage that will help me with SEO?
I myself was searching for some guide on SEO for ruby on rails, surprisingly there was no updated/recent article on the web (this post ranks #1 in google and this is also 3 years old) as that link seoonrails is dead and other articles are written in 2010 so I went ahead and wrote a complete SEO for rails guide http://www.inboundio.com/blog/seo-for-ruby-on-rails-complete-guide/. It took me 3 days to write it (including the infographic) and I have tried to link back to railscasts and other sources where ever possible to make it more helpful.
To answer OPs questions, following gems can be used as starting point -
Friendly ID - https://github.com/FriendlyId/friendly_id
Meta Tags - https://github.com/kpumuk/meta-tags
MetaMagic - https://github.com/lassebunk/metamagic
Sitemap - http://rubygems.org/gems/sitemap or http://rubygems.org/gems/xml-sitemap
Breadcrumbs - https://github.com/lassebunk/gretel
You can further refine your rails app with following gems
Rack cache (for caching) - http://rubygems.org/gems/rack-cache
GeoCoder (for geotargeting) - https://github.com/alexreisner/geocoder
Geokit (for geotargeting) - https://github.com/geokit/geokit
Mobile fu (for better Mobile Optimization) - https://github.com/brendanlim/mobile-fu
SEO is a field by itself. But for a rails app you could use the following gems to make you site more search engine friendly.
Metamagic http://github.com/lassebunk/metamagic
Headliner https://github.com/mokolabs/headliner
Gretel for breadcrumbs http://github.com/lassebunk/gretel
FriendlyID for SEO friendly urls http://github.com/norman/friendly_id
DynamicSitemaps for generating stiemaps http://github.com/lassebunk/dynamic_sitemaps
Finally all these and a small description on how to use them could be found on this blog post http://lassebunk.dk/2011/03/09/rails-seo-pack/ by Lasse Bunk
Sorry to resurrect such an old question, but it's been on my mind too, I'll share what I came up with.
As you probably know, SEO is pretty blurry in general. But these are a few of the core things that I've discovered from my reading. But I'm no SEO whiz.
A good strong name.
Every page's title attribute should somehow be titled for its content specifically. It's also not a bad idea to ensure that it has near 60 characters. As far as getting the title to change depending up on the page, you could do something like this:
http://railscasts.com/episodes/30-pretty-page-title (the railscast is a bit dated, maybe there's a newer way to get this done?)
Rails 3 - Ideal way to set title of pages (I kind of like the look of this one.)
Create a robots.txt file
You just throw it in your public folder with something like this, assuming you want all of your pages indexed:
User-agent: *
Disallow:
Create a Sitemap and submit it to Google Web Developer Tools
I just checked this one out, and it did what I wanted.
https://github.com/kjvarga/sitemap_generator
You might look at rails powered meta tags using the following gem, though, I've not used it:
https://github.com/parndt/seo_meta
And, I think that really wraps it up for rails specific things. There are so many other SEO resources out there, and so many of them are just things that you manipulate the view to accomplish, so they're not really rails questions at that point.
A few other things to think about as well, but they're not really rails specific, and mostly in your views.
Make sure your code is W3C valid
Title attributes for image tags.
Using header tags appropriately.
Don't put text in images, that's what text is for. If you want to use a pretty font, use google fonts.
Make sure you have outbound links to resources that make sense for the context of your page.
Create a printable stylesheet.
I believe the most important ingredients to SEO are:
good content and
good inbound links.
None of these can be achieved using any plugin.
See also SEO: Where do I start?

Resources