[Rails]

2013-06-11 Thread Vitaliy Yanchuk
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@google

[Rails] Run method if association does not exit

2011-07-27 Thread Vitaliy Yanchuk
Hello people, Please advice with, I have some models and they have feeds, feed is a small presenter for different types of content. class Feed belongs_to :attachable, :polymorphic => true end class Song has_one :feed, :as => :attachable end class Gallery has_one :feed, :as => :attachable e

[Rails] Plugin or Gem reuirement, if gem is not installed

2011-04-15 Thread Vitaliy Yanchuk
It is about rails2 I have a gem that I install as a plugin, I want in development environment use it from vendor/plugins folder and if it is installed in system to use the systems gem But if I use config.gem in environment.rb it raises an error about missing gem even if it is present in vendor/pl

[Rails] Re: establish_connection only on need

2011-01-20 Thread Vitaliy Yanchuk
Yes -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubs

[Rails] establish_connection only on need

2011-01-19 Thread Vitaliy Yanchuk
I have one abstract ActiveRecord::Base class that establishes connection to other db, and it does every time it is included, on every environment load. It starts to establish it at script/console for example. I need to move that establishing only when there is actual request per that model is made

[Rails] Re: CONTENT-TYPE for "render :text => 'som text'"

2010-11-24 Thread Vitaliy Yanchuk
Heh, thanks, I`ve tryed something like that, but well probably not the same Thanks a lot! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@g

[Rails] CONTENT-TYPE for "render :text => 'som text'"

2010-11-24 Thread Vitaliy Yanchuk
Want to make it easy and clean Sometimes I do render :text => obj.to_yaml I want it to be formated as it would be with header text/plain But rails sets it to text/html Would be perfect to have: render :plain_text => obj.inspect -- Posted via http://www.ruby-forum.com/. -- You received this m

[Rails] Re: Todays month first day and previous month first day

2010-11-03 Thread Vitaliy Yanchuk
Thanks all, the method beginning_of_month is just what I was looking for. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com.

[Rails] Todays month first day and previous month first day

2010-11-03 Thread Vitaliy Yanchuk
Hello everyone. Please advice how to get todays month first day and previous month first day. If go on by this post date, it will need to give me now 01-11-2010 and 01-10-2010 or if today was like 3 Jan 2010 it would be 01-01-2010 and 01-12-2009 -- Posted via http://www.ruby-forum.com/. --

[Rails] Re: Bundler install gems but not in vendor folder

2010-11-03 Thread Vitaliy Yanchuk
I`m not sure what you mean under "deploy", the command "bundle pack" just puts all gems that are need for your app to the vendor folder -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post t

[Rails] Re: Bundler install gems but not in vendor folder

2010-11-03 Thread Vitaliy Yanchuk
This is normal, to install gems to vendor plugin you need to run ~$ bundle pack -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroup

[Rails] Not restful way ?

2010-11-01 Thread Vitaliy Yanchuk
Please give a suggestion about the right way to do it in Rails. I have user profile form that is at url /my/profile It posts PUT request to update it to the same url, but map.resources in routes make put request with the need of :id option passed, but I know this id from customer, it should be det

[Rails] Re: Add prefix to dynamic routes that are created

2010-10-29 Thread Vitaliy Yanchuk
Ok, I found solution it is :name_prefix But I now have errors like edit_somename_arch_note_url failed to generate from {:controller=>"sysadmin/notes", :action=>"edit", :id=>#}, expected: {:controller=>"/sysadmin/notes", :action=>"edit"}, diff: {:controller=>"/sysadmin/notes", :id=>#} -- Post

[Rails] Add prefix to dynamic routes that are created

2010-10-29 Thread Vitaliy Yanchuk
Help me please, very urgent. I have resources that lay in plugin, they have structure like Somename::Arch::Notes Also I have controllers for this model in different controller, that lay in sysadmin/notes When the form is building with form_for it tries to generate path with method somename_arch_

[Rails] Inflect word depending on number

2010-10-27 Thread Vitaliy Yanchuk
How can I use proper word after number, depending on that number. For example I have message that says: for 23 monthes, or it can be 21 month. So I have to inflect depending on number -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Googl

Re: [Rails] I cant' use Netbenas to develop ruby

2010-09-23 Thread Vitaliy Yanchuk
Try to set config.action_controller.consider_all_requests_local = true for your development environment It will show proper Exeption message instead of "We're sorry, but something went wrong." On 23 сент. 2010, at 10:44, Tanawat Limungkura wrote: > I try to develop ruby with netbeans and mysql.I