Any assets manager on rails 3? - ruby-on-rails

Does anybody know any asset manager on rails 3 for upload/browse image/file? Like this one http://tinymce.moxiecode.com/enterprise/mcimagemanager.php

I once looked quite a bit for something similar and never really found anything remotely complete.
I got a few ideas from https://github.com/vinyll/rails-mediabrowser but unfortunately that looks unmaintained.

Related

This website is under heavy load, rails app

I am getting error, I tried searching a lot. And seen many posts but nothing worked for me. Any suggestions on how to fix this.
This website is under heavy load
We're sorry, too many people are accessing this website at the same time. We're working on this problem. Please try again later.
when I run free -m, this is the memory status
and seeing nginx configuration file, these are my settings
I tried modifying settings, according to different things specified by people on stackoverflow. But I still facing the issue
The Passenger documentation and the following article explain what this error is, why you get it, and how you can make it go away:
https://www.phusionpassenger.com/library/config/nginx/reference/#passenger_max_request_queue_size
What is optimal value for Phusion passenger PassengerMaxRequestQueueSize

Old ActionMailer templates being cached?

We're running a Rails 3.0.7 app with Passenger standalone + nginx and with ruby 1.9.2-p290, and we're seeing the strangest thing happen: After deploying some updates to a mailer template, new mails coming from the app sometimes have the updates applied, and sometimes the old template is being used.
I can't find anything about cached ActiomMailer templates online, and running rake tmp:cache:clear does not address the issue either, fwiw.
Has anyone ever experienced such a thing? Is there a definitive solution for this problem?
thanks,
Jacob
I've run into similar situations in our application, and we use Resque.
If I'm changing anything regarding mailers (which the Resque workers handle), I need to restart the workers.
Kill the workers and respawn them, it sounds like some of them might have the old environment loaded and others do not.
I was having this issue as well, although I wasn't using Resque to send mail. After staring at the offending templates for a while, I realized some of my inline CSS was incorrectly formatted (improper font-family and padding declarations) and that the template may have been ignoring everything else next to those declarations. As a result, it looked like it was pulling the old templates rather than rendering the new rules. Not sure if this is documented anywhere..
So, basically, I was lazy and it cost me a few hours of the day.

Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

I have just started using 3.0.7. I am about 2 weeks of development in.
I was wondering if I should keep building for 3.0.7 or switch to 3.1 before I have too much code to port over? I like most of the new features (my only fear is not having good error messages when I use coffeescript), so I'd like to code towards the latest and greatest if it's relatively safe.
The javascript standards look interesting, and the attr_accessible fix sounds like it's very much appreciated.
Is Rails 3.1 compatible with all the gems out there though?
Also, if I go the 3.1 route, is hard or easy to migrate my project towards it? How might one go about that?
I guess this is a lot of mini yet related questions. I'd really appreciate some answers. Thank you.
I think if you want to ride on Rails 3.1 you should do it :). As for me I have some projects on Rails 2.3.5, 3.0.5 and would like to port them on Rails 3.1 but there is to much code there :). So don't be afraid and go to the fresh stuff (unless your code overflow :) ).
Rails 3.1 are pretty stable for now (I didn't have much problems with installing and using it)
If you're only two weeks into a project then it makes sense to stay on the edge and move to 3.1.
The way I'd do it is clone my project to a new dir (you're using git / similar version control, right?), change the Rails version in my Gemspec, run tests and play around to see what got broken (if anything). Based on the results you can figure out whether the effort is too great.
Regarding gem compatibility, hardly anything is compatible with all gems out there. Since you're two weeks in, you probably know which gems you use. Test like I suggested and you'll have an idea whether it's compatible with what you need. If you're using popular gems, then they'll most likely be updated to work with 3.1 soon enough.

Starting out with vote_fu

Trying my luck with the vote_fu rails plugin. The functionality looks like exactly what I need for a project of mine, but I have hit a roadblock. I have followed the github readme to the letter, installing it as a plugin.
I have put acts_as_voteable on my "Event" model and acts_as_voter on my User model.
In the console, when I try:
>> event.votes
or
>> user.votes
it successfully returns an empty array.
but when I try to do the following:
user.vote_for(event)
I get
"NoMethodError: undefined method `user_id' for #<Vote:0x7f5ed4355540>"
Any ideas? I'm probably just missing something obvious, but maybe something is missing from the plugin's readme.
Thanks.
[Update]
I created a blank application and the plugin works fine, so I think that this problem might be being caused by the use of the "desert" plugin, as my User class is split over two files. If I find the answer, I'll post it so that in the off chance someone else runs into this it may be some help.
Cheers.
Ok, I haven't found a definitive reason why this problem occurred, but I do have strong suspicions that it is due to the use of the "desert" plugin, as my User class is split over two files (the project is using the CommunityEngine plugin as a base),
Anyhow, I found a work around (something I should have tried before posting here). Instead of installing vote_fu as a plugin, I installed it as a gem. And now vote_fu seems to be humming along nicely.
So let that be a lesson to you all!
:-P

acts_as_ferret multi model search not working in rails app

I am trying to solve a strange issue with ferret/acts_as_ferret
Of course I have googled and posted the question:
http://www.ruby-forum.com/topic/188570
Basically aaf works on single models with no issue. It also works on single models using the config/aaf.rb file I have setup. It even works when I do a multi-model search in the console, but within the rails app itself I get:
undefined method `ferret_rank=' for <object that has a match>
If anyone has had the same experience/problem and can shed any light I would appreciate it.
PS: I followed the following tutorial to get where I am now.
http://opensoul.org/2008/4/29/using-shared-indexes-with-acts_as_ferret
Do you have the plugin installed or just the gem? You might want to install the plugin.
I would also try rebuilding the index.
For my purposes, I switched to Solr and life is a lot easier. Sphinx is missing a lot of stuff that I need.

Resources