Re: [Rails] [Rails3] Model.model_name.human not working with ActiveModel::Translation

2011-02-03 Thread Konstantin Shabanov
mongoid: models: profile: Profile model should be in plural form. On Thu, Feb 3, 2011 at 3:53 PM, Erwin wrote: > I am using ActiveModel::Translation, it's working fine for attributes, > but I cannot get the Model name translated > > in the console I get .. > > >Profile.i18n_scope =

Re: [Rails] Install Issue with sqlite3.dll

2011-02-02 Thread Konstantin Shabanov
You need to put sqlite3.dll in the ruby bin dir or you can try http://rubyinstaller.org/ On Wed, Feb 2, 2011 at 9:44 PM, Parth B wrote: > Hi, I'm trying to install RoR on my computer following the instructions on > the download page > (http://rubyonrails.org/download***

Re: [Rails] Which State Machine?

2011-02-01 Thread Konstantin Shabanov
You can try aasm or transitions . On Tue, Feb 1, 2011 at 5:06 AM, Garrett Lancaster < glanc...@garrettlancaster.com> wrote: > Don't forget the ruote work flow engine > > -- > >Karl Smith >

[Rails] Re: Different database for different domains

2009-03-09 Thread Konstantin
On 9 мар, 16:33, Ar Chron wrote: > Haven't done it myself, but have you looked at > ActiveRecord::Base.establish_connection? > > If you can establish model-specific connections, you should be able to > establish a specific connection for a specific subdomain. Okay, thanks! The main problem is th

[Rails] Re: Different database for different domains

2009-03-09 Thread Konstantin
The first question remains, please, give me a key to resolve the issue. Currently I see only one way: symlink all files from one domain to another except /config folder, and put custom /config to every domain. But there should be more elegant solution! --~--~-~--~~~---~

[Rails] Re: Different database for different domains

2009-03-07 Thread Konstantin
> 2. > And another question about subdomains. > Usually I use something like that: > link_to 'Link title', :sort => 'soft_field' - and this produces a link > to the current url with additonal ?sort=sort_field > parameter:http://site1.com/controller/?sort=-sort_field > But this doesn't work on sub

[Rails] Different database for different domains

2009-03-07 Thread Konstantin
Hello! 1. I have 2 domains site1.com and site2.com. The same application is installed on both, but I need it to use different database: db1 for site1.com and db2 for site2.com How can I do this? 2. And another question about subdomains. Usually I use something like that: link_to 'Link title', :sor

[Rails] Re: gem update problem

2009-01-09 Thread Konstantin
It's very strange, but I still cannot force the update_rubygems to run correctly. I have tried the full path, but failed: $ sudo /opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/ rubygems-update-1.3.1/bin/update_rubygems Error: Cannot find RubyGems Update Path! RubyGems has already been

[Rails] Re: gem update problem

2009-01-09 Thread Konstantin
Ah, I guess the problem is in the paths! I have changed the standard "gem" command to work by default with Passenger. So, I guess, I should update the Passenger now? Here is an output of your commands: $ gem list -l ... rubygems-update (1.3.1) ... $ gem environment RubyGems Environment: - RUBY

[Rails] Re: gem update problem

2009-01-09 Thread Konstantin
No success :( $ sudo update_rubygems sudo: update_rubygems: command not found $ sudo update-rubygems sudo: update-rubygems: command not found On 9 янв, 11:28, MaD wrote: > after installing rubygems-update, just run > sudo update_rubygems --~--~-~--~~~---~--~~ Yo

[Rails] gem update problem

2009-01-08 Thread Konstantin
Hello! I cannot force a new application to run, it cannot update gems to the required version. Could you suggest a solution? $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:Ubuntu 7.10 Release:7.10 Codename: gutsy $ ruby -v ruby 1.8.6 (2007-06-

[Rails] Re: Advanced authenticated system

2009-01-05 Thread Konstantin
I have tried 2 plugins: subdomain-fu + Restful authentication, currently without any success. If you have a working example for this issue - it will be highly appreciated! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

[Rails] Advanced authenticated system

2009-01-05 Thread Konstantin
Hello! I'm looking for an authenticated system with namespaces and subdomains support. I want to make: admin.site.com, manager.site.com, etc Every admin can have different roles, f.i. admin_a can list users, admin_b can list, add and update, admin_c can list, add/update and delete users. I have

[Rails] Re: Render a view from console

2008-12-17 Thread Konstantin
> string = ActionController::Base.new.send(:render, :template => > 'cont/index') Unfortunately this doesn't work too :( >> ActionController::Base.new.send(:render, :template => 'cont/index', :layout >> => false) NoMethodError: You have a nil object when you didn't expect it! The error occurred w

[Rails] Render a view from console

2008-12-17 Thread Konstantin
Hello! In my application I'm trying to render a view from a class in /lib folder. I have found that it's very similar to render a view from console. So, I have tried different methods: >> string = ActionView::Base.new.render( :inline => 'works', :layout => false ) => "works" >> string = ActionVie

[Rails] Re: Access from common class

2008-12-17 Thread Konstantin
> It's not a global function. It's an instance method added to all > controllers Ok, but I want to render a template in this function. How can I do that if I put it outside the controller (for example, into a separate class in a /lib folder)? Other answers are really helpful, thank you :) Actual

[Rails] Access from common class

2008-12-17 Thread Konstantin
Hello! I have made a common class and put it to the /lib folder of my Rails application. Now I have some problems with access to: 1. Mailers Call to SupportMailer.send_activation_email gives an error: NoMethodError (undefined method `send_activation_email' for SupportMailer:Class): Ok, I have c

[Rails] POST request with custom headers

2008-10-21 Thread Konstantin
Hello! I want to send a POST request with some additional custom headers. How can I do that? I have checked next libraries: Net::HTTP, ActiveResource, XMLRPC But I didn't find necessary functionality. Can you suggest please? --~--~-~--~~~---~--~~ You received thi

[Rails] Re: require doesn't see a file

2008-09-17 Thread Konstantin
> Do you have two parallel installations of ruby (one normal one and the > ruby-enterprise one from Phusion) ? > If so you'll need to install ruby-iconv on that too. Yes, I have 2 installations, thanks for the tip. I have searched for a good solution, but no success :( Ruby Enterprise group has a

[Rails] require doesn't see a file

2008-09-17 Thread Konstantin
Hello! I have installed ruby-iconv port on FreeBSD and try to work with it in irb console: home# script/console Loading development environment (Rails 2.1.0) >> require 'iconv' => [] >> exit Works perfectly! But my Rails application doesn't see this library: MissingSourceFile (no such file to

[Rails] Re: respond_to and format

2008-09-11 Thread Konstantin
On 11 сент, 15:06, cheef <[EMAIL PROTECTED]> wrote: > wrong url? > check "myapp.com/foo.xml" No, no, the task was exactly reverse. I want to see normal html template (and not xml), but if I pass "format=xml" as a query parameter, Rails will try to display xml template (which doesn't exist) How to

[Rails] respond_to and format

2008-09-11 Thread Konstantin
Hello! I use a "format" parameter in my application for internal calculations. But Rails catches it and uses for view name. I mean, if I go to url: myapp.com/foo/?format=xml Rails tries to show me index.xml.erb view, but I don't want this! I want the application to continue showing index.html.e

[Rails] Re: How do I make an API?

2008-09-08 Thread Konstantin
> Why would you need to? You've already got mongrel or apache or > whatever sitting in front of it (unless you're not doing this over http) To say truly, it's my first API script (and the first daemon script), and I have poor theoretical knowledge in this area. So I have tried to make something,

[Rails] Re: How do I make an API?

2008-09-07 Thread Konstantin
> Why is your api not just some extra controllers and actions in your app? Will I be able to daemonize the script if it's a controller in my application? I think no. This is why I have chosen this way - I need to make my API script as a daemon. Btw, eventmachine gem seems to fit my needs :) I'm

[Rails] Re: How do I make an API?

2008-09-07 Thread Konstantin
Unfortunately I don't have a good recipe, but I'm trying to develop something similar (API for my Rails application) and here are my unpretentious results. I have made a standalone ruby script and include Rails configuration there: require File.dirname(__FILE__) + '/../config/environment' Thus I h

[Rails] Re: Speed up Rails and cgi script

2008-09-06 Thread Konstantin
Actually it's just a question to all experinced Rails developers: what kind of configuration do you have on your production servers? Pros/ cons of some software? It will be great if you can share some of your knowledge. --~--~-~--~~~---~--~~ You received this messag

[Rails] Re: Speed up Rails and cgi script

2008-09-06 Thread Konstantin
> That sounds a bit odd. The application is making http requests to > another script on the same machine? Is that other script reloading > rails each time it runs? Yes, currently it's odd :) Both cgi script and Rails app are on the same machine, and of course I can include the script without maki

[Rails] Speed up Rails and cgi script

2008-09-06 Thread Konstantin
Hello! I have a Rails application and a CGI script which uses this application models (api script). The application makes http requests to the api script and shows result. It works really slow... I have found some good topics about speeding up the Rails, but some are old, and others are about