Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Is there a good ruby gem for a WYSIWYG editor that will easily work with a rails app?
Though it's certainly not a direct answer, in the past I've found I prefer to use RedCloth (or a Markdown parser if you don't enjoy Textile) and use a simple textarea with an AJAXy preview. Generally speaking, WYSIWYG editors have a long history of creating redundant tags and similar, leading to potentially broken pieces of HTML.
While I know this has been answered I wanted to add regarding the use of textile... I completely agree, but I'd recommend processing it in a before_save filter. Let's say you have a database field called "details" - just add one called "details_html". Then do something like this...
before_save :convert_details
def convert_details
return if self.details.nil?
self.details_html = RedCloth.new(self.details).to_html
end
RedCloth can get a little process heavy and if you are constantly processing the stuff on each render you're going to run into some memory issues... this will just help lower some of your needed resources.
Update for 2010. I just implemented TinyMCE in a Rails app using the tinyMCE gem.
You can find it here: http://github.com/kete/tiny_mce
It took less than 5 minutes and in my basic testing, it's working perfectly. There was a commit in June 2010, so it looks like this is an actively developed gem.
Hope that helps some googlers.
I'm not sure about a Ruby Gem, but TinyMCE is a customizable, generally stable WYSIWYG editor that is fairly simple to integrate w/ any project. I've used it a number of times.
A similar question: What is the best WYSIWYG for Rails - Ruby on Rails Blog
I just pasted my same solution here too.
I strongly suggest you give WYSIHAT a try. The biggest problem with the editors mentioned above is its bulky size and "hard-to-customize"(ability). The bad code in most of these editors is a big turn-off. WYSIHAT is more like a framework for a WYSIWYG editor. Extremely easy to customize. Easy to configure. And what more.. Its backed by 37signals. What i would appreiciate about TinyMCE is its paste from word feature which preserves the layout. But if not for that one feature i find the rest really bulky.
Please do read this article: http://37signals.com/svn/posts/1330-introducing-wysihat-an-eventually-better-open-source-wysiwyg-editor
Tutorial on using WYSIHAT: Part 1: http://jrmehle.com/2009/01/25/wysiwhat-wysihat-part-1/
Part 2: http://jrmehle.com/2009/02/13/wysiwhat-wysihat-part-2/
And to make your life even easier theres an awesome rails-engine developed by Jeff Kreeftmeijer (80beans.com) for the 37signals WYSIHAT editor: http://github.com/80beans/wysihat-engine
And heres an article by Jeff Kreeftmeijer: http://www.80beans.com/2009/10/01/wysihat-engine/
I use FCKEditorOnRails plugin: http://github.com/UnderpantsGnome/fckeditor_on_rails/tree/master
Note that you can generally drop in the latest version of FCKEditor without much tweaking if you're running into bugs in the older version.
Have a look at http://livepipe.net/control/textarea
for a WYSIWYG markdown editor with the AJAXY preview mentioned in the chosen answer.
There is a plugin to use TinyMCE with rails, lots of information on the rails wiki.
+1 for FCKEditor - there is a great Rails plugin that includes helpers. However it is often overkill as it features everything. In many cases something a little simpler such as jQuery's WYSIWYG editor is great for wrapping a text area input.
I'm really loving CKeditor gem. It's much, much more elegant than TinyMCE, especially if you deal with raw HTML. CKeditor displays on page--TinyMCE gives a popup. CKeditor allows access to things like all headings right out of the box, too. TinyMCE requires hacking.
RedCloth's inability to support ALL HTML was a dealbreaker for me. (Among other things, you can't support giving an image a description OR a caption!!!!) I didn't mind the markup so much as the complete lack of flexibility. Plus, it was like learning a new language--a lot of the markup was the opposite of intuitive (like image alignment), and I couldn't possibly imagine asking contributors to learn all that.
For comments, I will use something much lighter weight, though.
I had bad experiences with CKEditor (gem "ckeditor") .. I managed to get it to work on local maschine but had a lot problems when trying to deploy it to Heroku .. It seems like code is too heavy to automatically precompile the code on Heroku ... That means it is quite useless ...
EDIT:
Solution: make sure that you precompile javascript before deploying it on Heroku.
I would use Tiny MCE it is a Java Script solution I have integrated with Web Applications to edit HTML.
http://www.tinymce.com/
Related
There are several WYSIWYG editors out there, such as TinyMCE, CKEditor, etc. However, IMHO these editors don't have a nice and modern appearance like Froala. Problem is that Froala costs, and it sucks because this is just an internal app that I plan on using long-term without anyone else even looking at it.
TinyMCE and CKEditor also seem to have some pretty terrible themes. I'm ultimately wanting to get something inside of my ruby on rails application.
Does anyone know of any modern looking WYSIWYG editors that actually look like they were developed in the last 10 years? I have a beautiful theme for my rails app and I just don't want to kill it with some old looking theme.
Not looking to get flamed and yes I've googled, but I came here because I really can't find what I'm looking for and hoping someone else can shed some light.
I really don't see a whole lot of difference between Freola and TinyMCE, or the HTML editor this website uses.
Can you list specific features you're looking for that the items in the list don't do? I know you mentioned theming, but there are literally hundreds of themes for TinyMCE and you can roll your own without much effort at all.
The best WYSIWYG I've come across is Redactor. It costs $500 for a developer license:
There is a gem called redactor-rails which provides it for free (I don't know how).
It is the most efficient & good-looking I've come across.
If you want functionality with the likes of Paperclip etc, we've used CKEditor extensively. Yes, it looks crappy but I believe there are ways to style it:
I can give you the code we use if you want to try it. Once you get rid of 99% of the non-essential elements, it starts to look good.
I am doing my application using RoR, which make me very annoying is the layout issue, I know the RoR have a really great MVC to isolate the UI out or the application logic, but it is still really annoying to work with CSS across different browsers. Is there any way to reduce that work load? thank you.
The problem you described (if I understand it correctly) has nothing to do with Rails and MVC. CSS and browser compatibility problems are separate from server-side frameworks - I mean, they are the same whatever language or framework you use.
However, there are tools that can ease the pain, for instance, here is a good article on using Compass gem and Blueprint (btw, it also mentions HAML and SASS which you may accidentally fall in love with, and these are IMO huge).
Sadly , the answer to that is no . How hard you try , if your layout is even slightly complex , you need to take care of cross browser issues . This question has a few good suggestions and tools available that maybe can speed you up .
HAML is the best option for you .I am using HAML last one year its very fast after familarize on that
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I've been playing around with JQueryUI for my latest project. I've run into some issues and questions, and I've not been able to solve them either myself or with the help of SO.
Here's my current impression:
Styling the UI seems quite daunting .. a lot of "framework" to understand before being able to do stuff
not much help either by googling or by asking questions on SO .. doesn't look like there is a huge community to support it
What is your opinion? Should I "tough it out" (I admit that this may be more my problem than a problem of JQueryUI) or should I look for alternatives?
I have to admit to having some reservations about jQuery UI. Basically it comes down to this: it smells funny.
Now I have enormous respect for jQuery proper. It's fast, lightweight and it solves a whole heap of browser compatibility issues. It's also extensible via plugins that you can use or not at your discretion.
jQuery UI is a different beast. The whole theme thing is really heavyweight. What I mean by that s that, for example, if you just want a date picker, you need a theme for that and thats a lot of CSS and a lot of configuration just for a datepicker. Compare that to a datepicker plugin where you just use it (or not).
The whole premise of the heavyweight theme thing is that it looks built to a huge UI framework with a dizzying gallery of widgets... but there isn't a dizzying gallery of widgets. There's just a handful. So why the complex theme configuration?
To me it just seems over the top. If I were you I'd pick up widgets for things you need and possibly look at something like jQuery Tools, which seems to be less convoluted.
In my opinion jQueryUI is a mature and reliable framework. There is definitely an active community supporting it and plenty of information is available on blog spots and discussion forums.
Have a look at ThemeRoller. This is an excellent tool for easily creating themes for jQueryUI. It will help you when starting playing around with it.
I would perservere with it, but bear in mind that if you have what seems to be an insurmountable problem with a particular control there's generally an alternate version available in one of the many blog posts that have sprung up about JQuery.
By sticking with the framework, you'll learn how to extend it yourself, which will allow you to introduce new functionality (for instance, I recently wrote an internationalisation component in JQuery that allows me to retrieve resource strings from a web method via AJAX calls in ASP.NET).
And why not? I'm using only a few things from it and i feel happy (i.e. - 'highlight' effect).
Just don't forget to reference it through Google Api. As long as you do that - it's quite likely that you do not slow anything down (at least - not much) and lose practically nothing.
Did you consult the jQuery-UI discussion group? Maybe you can get more help there. If not, and if you decide to use jQuery-UI, then there's also commercial support (see here).
I don't think it is all that useful. It used to include autocomplete, which i thought was the most useful feature, but then they suddenly dropped it. It is a huge download if you include everything.
I've found jQuery UI quiet handy when I need to whack something together quickly, i.e. for prototyping, but like you I've also found support somewhat lacking and as mentioned above the theming leaves something to be desired.
On a recent project, looking for an alternative, I've used a couple of widgets from YUI and I have to say I'm very impressed with the whole architecture and methodology behind it. For example their autocomplete abstracts away the data source and provides overridable methods to fine tune the results set.
Finally, if I have time, I'm a big fan of rolling my own widgets. Re-inventing the wheel can be a great way to expand your knowledge and you never know, you may happen across a better solution :-)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have been interested in learning Rails for some time now and feel now is as good as time as ever to dip in and actually get my hands dirty. I've spent the past week reading every free ebook on Ruby and Ruby on Rails I can find. I just finished reading Ruby Essentials. I have also been playing with http://tryruby.hobix.com/
I have installed Ruby, Rails, MySQL, PHP, phpMyAdmin on a Windows XP machine, I also have access to a Ubuntu machine.
I come from several years of PHP experience and around a year using CodeIgniter.
What I would really like now is a fairly basic Rails app that is a little more in depth than Hello World but not quite up to par with say a forum or blog.
I find its much easier to learn how something works when I can play with already made code and do some trial and error changes.
What I am really looking for is that 'Ohhh, I totally understand now!' moment I had when I first started learning PHP.
Does anyone have an app or know of one that could possibly provide that moment?
Check out the screen casts on Rails at BuildingWebApps . I've watched several and they have been exactly what I was looking for when learning rails. They start simple and keep adding more and more functionality. The commentators move at a good pace and subscribing to the lessons is free.
If you want something that is built already build the sample application that comes with Agile Web Development on Rails, buy the pdf from pragprog.com, the latest version is set to work with Rails 2.2, so will work with 2.3 as all the basic features of the framework will be the same.
When you are ready to move on from that, the Rails Guides website is all new and is a great resource for all developers new and old.
dwc is right though, a blog is a good thing to start on your own, so when you are confident give it a go, even if you don't put it in production it will help you along.
I would recommend railsforphp.com. They have a PHP to Ruby reference which could be quite helpful.
You can also buy the 'Rails for PHP Developers' book as either a paper or digital copy (or both if you really want to). The book is full of examples that show the PHP way and how it compares to the Ruby/Rails way.
As for ready made code, I suggest having a play with Enki. It is a somewhat bare-bones blogging system that should give you a good testing ground.
You should rethink your idea that a blog is too complex. At it's simplest a blog is a textarea and a submit button, and then storing and regurgitating the results. Start with that to get your hands dirty, then add features as you go. In fact, why not practice some Agile and do your own iterations?
The Rails Guides are nice http://guides.rubyonrails.org/
If you don't like the blog idea, you could make a wiki, this isn't very complex either. you simply need a edit button on every page with the text from the linked to it. This will teach you how to handle rails and play with ruby for things like regular expressions and such.
Take your time, break down these problems and and they should be easy for you to solve with rails.
And go on IRC (server freenode channel #rubyonrails) you can use MIRC for that. Ask questions there, I usually am there, (look for nims).
My suggestion would be to start with a simple CMS. This is something you can continue to use and expand as your skills progress and you start other more complicated projects. In the most basic form, this consists of a Page model, and a Topic model. You could then add a User model, some login capabilities and a simple admin interface. After all, Rails was originally envisioned to make it easy to CMS type sites.
As you get this up and running, you can add some plugins to extend the functionality to include tagging, comments, and more. Or you can roll these capabilities yourself.
Set up an account on Github and learn how to use Git. Its great, and better than what you used before (if anything.) You should also learn rake, and capistrano, as these are huge timesavers and work hand in hand with Rails and Github.
http://blog.caboo.se/articles/2007/4/11/sample-rails-application
http://www.railsinside.com/elsewhere/100-7-barebones-rails-apps-to-kick-start-your-development-process.html
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
One thing I really miss about Java is the tool support. FindBugs, Checkstyle and PMD made for a holy trinity of code quality metrics and automatic bug checking.
Is there anything that will check for simple bugs and / or style violations of Ruby code? Bonus points if I can adapt it for frameworks such as Rails so that Rails idioms are adhered to.
I've recently started looking for something like this for Ruby. What I've run across so far:
Saikuro
Roodi
Flog
These might be places to start. Unfortunately I haven't used any of the three enough yet to offer a good opinion.
Saikuro and Flog can be good for getting a basic idea of code complexity. You can also use a tool like rcov to look at your test coverage.
There is a plugin for Rails projects that combine all those metrics into a single rake task. It is called metric_fu.
Projects I've found and tested recently:
https://github.com/railsbp/rails_best_practices
Seems to work, and gives sensible warnings
https://github.com/simplabs/excellent
Works, but quite a few false positives
https://github.com/troessner/reek
I disagree with most of the warnings from this tool, but it works
http://www.cs.umd.edu/projects/PL/druby/
This requires ocaml; I haven't tried it, but it looks like it might be good
http://roodi.rubyforge.org/
does not appear to be Ruby 1.9 compatible
https://github.com/gdb/ruby-static-checker
Is broken for me, and only catches name errors, so unit tests should cover that.
https://github.com/michaeledgar/laser
Doesn't compile for me
You might want to try out RuboCop. It is a Ruby code style checker based on the Ruby Style Guide. It's maintained pretty actively and it's based on standard Ruby tooling (like the ripper library). It works well with Ruby 1.9 and 2.0 and has great Emacs integration. I hope you'll find it useful!
Dust looks like it can help you find unused and useless code, which seems like it sort-of fits what you're after.
I'm not aware of any other such tools.
This problem is vastly harder to address in ruby than it is in java - you'll note that all those java tools brand themselves as using 'static analysis' of the code.
Static analysis of ruby code often isn't possible, because there isn't anything static that you can analyze (methods often get created at runtime and so on)
At any rate, some of these things are unneeded in ruby because the language builds them in.
For example, you don't need a coding standard to enforce that your classes are all NamedLikeThis because the code won't work if they aren't.
P.S. I have to add the standard disclaimer that those kind of tools can often be a bit of a red herring. You can spend all day making your code adhere to what the tool thinks it should be, and end up with more bugs than you started with.
IMHO the best solution is to write your code fluently so you can read it more easily. No amount of static analysis is going to be as good as a human reading code which clearly states what it is meant to do. Being able to do this is where ruby is light-years ahead of many other languages. I personally would recommend you aim your efforts at learning how to write more fluently, and educating your team about such things, than spending time on static analysis.
Another nice tool, although in early stages according to the author is reek:
http://reek.rubyforge.org/
reek currently includes very naive checks for the following code smells:
Long Method
Large Class
Feature Envy
Uncommunicative Name
Long Parameter List
Utility Function
Nested Iterators
Control Couple
Duplication
List item
Personally I think it still has too much false positives, but just looking at the output in some of my code helped me rethink some decisions about code style and architecture.
Code Climate is a SaaS tool that integrates through git and automatically "grades" your code. It notifies you via various channels if there a sudden drop in quality. Nice UI as well.
I didn't see this questions when asked, but a blog post I did might help as well. In it I cover a bunch of Ruby tools and specifically cover 4 code quality tools...
Roodi
Dust
Flog
Saikuro
It might also be worth checking out Towelie and Flay
http://devver.wordpress.com/2008/10/03/ruby-tools-roundup/
Now we have combined a lot of tools into an only Ruby code quality and metrics monitoring tool called Caliper. This might fit your needs well. It tracks various quality metrics over the life of a project.
Caliper - improve your Ruby code
There is also excellent. I haven't tried it yet, but it too looks promising.