|
Posts Tagged ‘plugin’
Thursday, September 18th, 2008 by Thilo Utke
I find it rather hard to choose the right size for text boxes. They are either to small so that you feel like caged in while writing into them or they are so big that you feel lost in that great white emptiness. These times are past since someone came up with auto expanding text areas (e.g. facebook uses them).
For one of our rails apps we use John R. Wulff’s ‘text_area_with_auto_resize‘ plugin. The plugin will give you auto growing text boxes for all text_area calls. I wrote a little extension for prototype’s (1.6.x) in-place editing text area that makes these text areas auto growing as well. So we can have auto growing text areas all over the place.
Tags: auto growing, plugin, prototype, rails, text area, usability Posted in Uncategorized | No Comments »
Tuesday, June 3rd, 2008 by Alexander Lang
We have again released a new plugin. Continuing the series of completely original names it’s called totally restful authorization.
The exec summary: you can declaratively add permissions to your (ActiveRecord) models for creating, viewing, updating and destroying them. A set of before filters automagically checks all incoming requests on your restful controllers for the permission and grants or denies access based on the permissions declared on the respective model.
How to install
Now with Rails 2.1 out all you have to do is script/plugin install git://github.com/langalex/totally-restful-authorization.git.
How to use
Include he PermissionCheck Module into the controllers you want to be checked or simply into the ApplicationController to secure your entire application.
class ApplicationController < ActionController::Base
include PermissionCheck
…
end
Second, declare permissions on your model using the built in domain specific language.
class User
updatable_by :admin # updatable if updater.admin? return true
updatable_by :self, :except => [:admin] # special role self, allow all attributes except some to be updated
updatable_by :newbie, nly => [:description] # only allow some attribute to be updated
viewable_by :anyone # special role, includes nil
destroyable_by [:admin, :root] # declare multiple roles at once
end
That’s it. From now on all requests will be checked against your model permissions and be blocked if the authorization fails. For more details see the README and the unit tests. (Btw. if anyone has a good idea on how to replace the controller tests with RSpec specs, i.e. get controller specs working in a plugin please tell me)
Tags: authorization, declarative, dsl, permission, plugin, rails, rest, transparent Posted in Uncategorized | No Comments »
Friday, April 25th, 2008 by Alexander Lang
This is our latest and also largest plugin for ruby on rails so far. After the installation it adds a social feed as seen in the picture to your rails application. The sources have been extracted from autoki which has had a social feed for a couple of months now, so rest assured we have put some thoughts into it over time.
Features so far: As a user I can decide what kinds of events I want to see on my social feed and also wether I want to be sent an email when an event occurs. I can also decide wether others will receive a notification on their social feed concerning my own actions.
The plugin includes model extensions for the user, a controller and views for viewing the feed and editing settings as well as a generator to easily create new event types so, getting started only takes a couple of minutes. For more info check out the README or get the sources from github.
Tags: open-source, plugin, rails, ruby on rails, social feed Posted in Uncategorized | 12 Comments »
Saturday, April 12th, 2008 by Alexander Lang
dead simple reports is a Ruby on Rails plugin that allows you to create reports from your application data within minutes. As of now it can not only generate HTML tables and CSV files but also M$ Excel spreadsheets. This is possible through the use of the spreadsheet-excel gem. You can grab a copy from the git repository or just download it from there.
Tags: excel, plugin, rails, reporting, reports, ruby Posted in Uncategorized | 3 Comments »
Monday, March 3rd, 2008 by Alexander Lang
Na endlich. Nach all den Jahren des nur-Geldverdienens und Open Source-Ausnutzens haben wir es geschafft, ein paar erste Zeilen Code in die Freiheit zu entlassen: dead simple reports, ein Rails-Plugin, das Reports generieren kann. Mehr dazu im neuen Bereich Open Source
Tags: open-source, plugin, rails, reports, ruby, upstream Posted in Uncategorized | No Comments »
Wednesday, July 18th, 2007 by Thilo Utke
Seit kurzen beunruhigt uns die folgende Fehlermeldung: Mysql::Error: Lost connection to MySQL server during query. Sie tritt immer wieder sporadisch ohne erkennbare Ursache auf. Heute Nacht bin ich eher durch Zufall auf eine Erklärung und idealerweise auch auf eine Lösung des Problems gestoßen.
Kurz zusammengefasst: ActiveRecord verwendet pro Model eine Datenbankverbindung. Wenn die Datenbank unter Last steht, kann es passieren, dass die Verbindung nicht schnell genug bereitgestellt wird und der Lost-Connection-Fehler auftritt.
Über das setzen von ActiveRecord::Base.verification_timeout=14400 oder einen Wert niedriger als die MySql Server interactive_timeout -Einstellung in der environment.rb lässt sich der Timeout heraufsetzen. Um dem Problem nachhaltig zu begegnen, hat Tyler Kovacs von zvents das Pluginmysql_retry_lost_connection geschrieben, das versucht, die Verbindung erneut herzustellen, wenn es einen Timeout gab.
Tags: error, lost-connection, mysql, mysql_retry_lost_connection, plugin, rails Posted in Uncategorized | 2 Comments »
Friday, March 23rd, 2007 by Alexander Lang
in the last days i started implementing caching for autoki.com. my first stop was this excellent rails caching tutorial over at railsenvy.com.
basically, rails offers 3 ways of caching page content:
- page caching: an entire page gets stored on the hard disk and can then be served by apache instead of rails – very fast but almost useless for us, as every page has some dynamic element in this. we still consider it for some ajax calls.
- action caching: also caches the entire page, but it’s still served by rails, which means before_filters for stuff like authnetication still work – still not for us, see above
- fragment caching: as the name implies caches fragments of a page – yay, sounds good
fragment caching
the basics are really easy. first, you simply surround the parts of the page that you want to cache with a <% cache ' ... <% end %>. this writes the fragment to a file in /tmp/caches and from now on, rails serves this part of the page from the cache.
this alone doesn’t get you any performance improvements yet, because your controller is still loading all the data from the database before rendering the view. to avoid this, you wrap your data loading code into unless read_fragment 'name' ... end blocks – now you page should be running lightning fast already.
the third problem to tackle is to clean the cache at the right time. this can either be done in the controllers by calling expire_fragment 'name' or by using so called sweepers. they are basically observe your models and clean the right fragments on events like after_create – so when you add a new user to the system, you can clean the list of users from the cache.
(more…)
Tags: caching, expire-cache, fragment-cache, fragment-cache-test, plugin, rails, ruby, testing, time-fragment-cache Posted in Uncategorized | No Comments »
|
|