[Rails] Cancan redirect back at AccessDenied

2011-06-05 Thread Yiannis
Hello I have a rails 3 app and I am trying to implement the redirect back action at access denied for cancan. If I try this in my application_controller: rescue_from CanCan::AccessDenied do |exception| redirect_to :back end It gives the following error: No HTTP_REFERER was set in the

[Rails] Re: Thin vs unicorn vs passenger

2011-05-31 Thread Yiannis
g of other solutions. If I use nginx instead of apache, will this help with the problem? On 31 Μάϊος, 11:22, Peter De Berdt wrote: > On 30 May 2011, at 20:12, Yiannis wrote: > > > I bought a new server and I was wondering what application server is > > the best choice for a typica

[Rails] Thin vs unicorn vs passenger

2011-05-30 Thread Yiannis
I bought a new server and I was wondering what application server is the best choice for a typical web application with rails. I've thought for a long time that the best choice was apache/nginx and phusion passenger but nowadays I am hearing a lot about thin and unicorn. I have used passenger a lo

[Rails] Re: Rais 3, nested attributes problem with paperclip

2011-05-27 Thread Yiannis
It worked. I tried many things and now it uploads my images. Thank you even though I didn't understand what was wrong. On 28 Μάϊος, 04:06, David Kahn wrote: > 2011/5/27 Yiannis > > > Yes! Sorry David I meant exactly what you wrote and yes my GirlPhoto > > model has a

[Rails] Re: Rais 3, nested attributes problem with paperclip

2011-05-27 Thread Yiannis
orial => http://sleekd.com/general/adding-multiple-images-to-a-rails-model-with-paperclip/). On 28 Μάϊος, 03:44, David Kahn wrote: > On Fri, May 27, 2011 at 7:23 PM, Yiannis wrote: > > I have two models, one model girl and one girl_photos (a file upload > > asset). The only code

[Rails] Rais 3, nested attributes problem with paperclip

2011-05-27 Thread Yiannis
I have two models, one model girl and one girl_photos (a file upload asset). The only code I have in models which describes the association is: For the girl => belongs_to :girl and has_attached_file :photo For the model girl_photos => has_many :girl_photos and accepts_nested_attributes_for :girl

[Rails] Re: Best image upload plugin?

2010-09-29 Thread Yiannis
I'd recommend using a virtual machine with linux on top of windows. Windows have many issues, try something like http://www.virtualrails.org/ . You will change something now and you will be forced to change it again in case of the deployment on a linux server. On 29 Σεπτ, 12:03, NARKOZ wrote: >

[Rails] Re: Will a Quad-core i5 processor significantly speed up development on Linux or Mac?

2010-09-09 Thread Yiannis
Indeed, that's why you better go for a OS change :). I think that you don't need a very strong pc for rails development, just a pc with linux and you are ready for action! I believe 2gb can also do the work. If you are designing thinks and need something for design then ok buy a strong one, if you

[Rails] Re: Ruby on Rails IDE

2010-08-26 Thread Yiannis
I feel that the whole community is supporting mac and textmate but I found that this is a problem. We should use cross platform tools if we want more people to try rails. All the screencasts I have seen are using with textmate, for example how easy it is to setup an autotest without growl, rspec wi

[Rails] Re: Layouts in Rails 3.0

2010-08-26 Thread Yiannis
I think it should be layout "admin" . For some reason symbols in the layout doesn't work. On 26 Αύγ, 06:22, Bharat Ruparel wrote: > I have an admin section in my rails 3 app. where I want to use a > different layout than the main layouts/application.html.haml layout. > Here is the snippet of th

[Rails] Re: Ruby on Rails IDE

2010-08-24 Thread Yiannis
> Why do you want to use either, instead of something like KomodoEdit or > TextMate? 1) Textmate is only for mac, I prefer ubuntu :) 2) Textmate doesn't have real code completion 3) Textmate isn't good as an editor... it doesn't have tabs if you don't use a project and even to move the sidebar, yo

[Rails] Re: Ruby on Rails IDE

2010-08-24 Thread Yiannis
I think I should try Vim or emacs with rails but I don't know with who I should go with. I tried both and I feel the same... The most people are using vim in ruby community, why? I heard that vim scripting can be replaced with ruby, is this true and that is the reason that the most people are using

[Rails] Re: Development Environment (Beginners Question)?

2010-08-01 Thread Yiannis
I was developing in windows for a long time but it had many constrains and problems. The best advice is of Michael Pavling, to use a machine similar to the server that you will do the deployment. I can't give up windows so I installed a ubuntu 10.04 server edition in a virtual machine and it is wor

[Rails] Re: Is TDD really followed in the industry ?

2010-07-14 Thread Yiannis
Any good book or resource to start learning TDD with rails? On 14 Ιούλ, 18:58, Colin Law wrote: > On 14 July 2010 16:18, lucky in ruby wrote: > > > Hey, > > > I am a rails beginners. I have created a couple of simple applications > > without following TDD. > > > I have a question - Do good pro

[Rails] Re: Oracle problem with encoding

2010-06-14 Thread Yiannis
I found the answer, it is: ENV =[NLS_LANG =AMERICAN.AMERICAN.AL32UTF8] Thank you On 14 Ιούν, 13:11, Yiannis wrote: > I have oracle 10g and my db is in AL32UTF8, I had install oci8 from > oracle but when i run a query the greek characters returns with ???. I > tried also with dbi bu

[Rails] Oracle problem with encoding

2010-06-14 Thread Yiannis
I have oracle 10g and my db is in AL32UTF8, I had install oci8 from oracle but when i run a query the greek characters returns with ???. I tried also with dbi but with no luck. My ruby version is 1.8.7 and my system ubuntu 10.04. Here is my code: require 'rubygems' require 'unicode' require 'icon

[Rails] Re: Choose ruby version for a Rails

2010-06-11 Thread Yiannis
0:36, Greg Donald wrote: > On Thu, Jun 10, 2010 at 5:25 PM, Yiannis wrote: > > initializer.rb:271:in `require_frameworks': no such file to load -- > > openssl (RuntimeError) > > > Any ideas what it might been wrong? > > Install your missing ruby openssl l

[Rails] Choose ruby version for a Rails

2010-06-10 Thread Yiannis
Well I am having a really weird problem, I am working on a project of another team and they were using ruby 1.8.7. I has installed ruby 1.8.6 so I've got many ruby errors and I couldn't figures out why. Finally I found that the reason was the version of the ruby, I have installed RVM and I set 1.8

[Rails] Re: Choose ruby version for a Rails

2010-06-10 Thread Yiannis
Well the problem was that I ran the command as a root (sudo script/ server) so the ruby 1.8.6 was used. When I am running for the version 1.8.7 I am getting the following errors: /home/nikos/.rvm/gems/ruby-1.8.7-p249/gems/rails-2.3.5/lib/rails/ gem_dependency.rb:119:Warning: Gem::Dependency#versi

[Rails] Re: Private methods in rails

2010-05-24 Thread Yiannis
You opened my eyes! I haven't figured out what private was. I thought that you could access the method logins/set_as_admin even if it was private because I thought by /logins/ you have access to the class, that's what I understood before when I read that private methods could accessed by the class

[Rails] Private methods in rails

2010-05-24 Thread Yiannis
Hello I was reviewing some rails code lately and I see that in some cases they use private methods (especially in application controller methods). I understand that it is considered a good practice since the methods aren't used anywhere else outside of application controller, but my question is:

[Rails] Re: spree commerce (or other open source ruby shopping carts)

2010-05-20 Thread Yiannis
Spree has nice architecture and logic with extensions, but currently it has many bugs. It is in version 0.10... I was impressed by his architecture but dissapointed by the bugs :(. I started to fix them, it wasn't difficult to fix what bug I found but I was thinking if it has so many bugs now that

[Rails] Re: hostingrails.com appears to have had an ownership change.

2010-04-29 Thread Yiannis
Indeed, hostingrails is the worst rails hosting company available. If you want to try the worst, try hostingrails. On Apr 28, 11:25 pm, "schag...@gmail.com" wrote: > Same here, we are now down for our second full day.  Our environment > is pointing to code from 2008 in our largest locations.  I

[Rails] Re: does any one knows how to setup ror on hostmonster

2010-04-29 Thread Yiannis
You should ask them to create you an SSH account. After that, it depends of your OS for how to login. If you are using windows, download putty, else in OS X or linux you can login directly from the console On Apr 29, 10:20 am, nirosh wrote: > thanks          Brijesh Shah > > please let me know h

[Rails] Re: Rails I18n

2010-04-26 Thread Yiannis
TSagar I am not sure I quite understand your example, it will translate the string "Role" in each language and there are many approaches to do a multilingual database design. I would make a database multilanguage design by setting each language in separate table, this approach will be normalized.

[Rails] Rails I18n

2010-04-26 Thread Yiannis
I was just wondering about locales and .yml files. Is it better to store the multilanguage strings in .yml files than in databases? And if yes, why? I was also wondering how rails are loading this files (for example, I have 4 languages in my web app, each has her own .yml file, will my rails app

[Rails] Rails and PHP app under the same domain

2010-04-02 Thread Yiannis
Hello I have a rails site in a domain like http://domain.com/ which is in one folder the whole application and a blog (wordpress - php application in another folder) under http://blog.domain.com/. How can I do http://domain.com/blog/ shows up the php application? Thank you! -- You received thi

[Rails] Re: Redirect 301 and cache

2010-01-09 Thread Yiannis
Thank you all for the help, I finally make it work as far as I test it (even though I don't totally understand how it works). The htaccess is the following in case someone else need it: AddHandler fcgid-script .fcgi AddHandler cgi-script .cgi Options +FollowSymLinks +ExecCGI RewriteEngine On Rewr

[Rails] Re: Redirect 301 and cache

2010-01-09 Thread Yiannis
Unfortunately I am using fastCGI to deploy and my hosting doesn't support custom httpd.conf files. I think the only way is within rails or with .htaccess. -- 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

[Rails] Re: Redirect 301 and cache

2010-01-09 Thread Yiannis
Thank you very much philip, I have also tried this but it seems I have a problem with my dispatch.cgi (I am using fastcgi to deploy). When I am trying I get this error "Routing Error No route matches "/dispatch.fcgi" with {:method=>:get}" Here is my full .htaccess: AddHandler fcgid-script .fcgi

[Rails] Redirect 301 and cache

2010-01-08 Thread Yiannis
I want my rails app to redirect from no-WWW to WWW domain (for example if I enter example.com/test to redirect to www.example.com/test). I put the following code in the application controller and worked fine: before_filter :check_uri def check_uri if !/^www/.match(request.host)

[Rails] Permalink and cache page

2009-12-13 Thread Yiannis
I made the example in railscasts 117 http://railscasts.com/episodes/117-semi-static-pages for clean urls and static pages and it worked fine. After that I wanted to do a simple page cache with pages_cache and expire_page (as in railscasts 89 http://railscasts.com/episodes/89-page-caching). The p

[Rails] Re: Why do so many Ruby/Rails developers use Macs?

2009-12-05 Thread Yiannis
Well this was something that I found also a bit weird when I began learning rails. I generally don't like apple because they obligate you to buy also the hardware for having their OS, programs and the like... Except from all of that and most importantly, as a web developer I need many versions of

rubyonrails-talk@googlegroups.com

2009-10-01 Thread Yiannis
Hello I have a strange problem with this code: <%unless (@students.empty? and params[:commit].nil?) %> <%="test"%> <%= render :partial => 'results' %> <% end %> Even though in some cases @students.empty? returns false and params [:commit].nil? returns true (or the opposite), it displays the t