search for: yves_duf

Displaying 20 results from an estimated 36 matches for "yves_duf".

Did you mean: yres_def
2011 Feb 27
10
How to store the same key multi times in a Hash ?
given an Arra tags[] I need to produce a resulting Hash as following .. { "$in" => [tags[0]], "$in" =>[tags[1], ...} in which the key should be always the same and the value being an Array I tried this : myHash = {} tags.each do |tag| h = {"$in" => [tag]} myHash.merge!(h) end but the merge! is only
2011 May 22
6
How to capture correctly a specific exception
I a using delayed_job, and I am raising an exception this way : config/initializers/custom_exceptions.rb class RemoteLockerException < StandardError; end class RemoteLockerDenied < StandardError; end lib/instruction_request_job.rb class InstructionRequestJob < Struct.new(:style, :request_id) def perform .... > connector =
2010 Aug 12
4
[Rails 3] How to test routes urls in console
I tried require ''url_writer'' but this is not the trick what should be required/included to test the routes urls ? thanks erwin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this
2011 Apr 23
3
Rails3 how to scope it, using a serialized array ?
giving a simple model, with a serialized Array attribute class Instructor < User .. serialize :languages, Array I am looking in defining scopes like this : >scope speaking_english, lambda { where("languages ... includes.... ?", :en) } which look for instructors in which the languages array include ":en" Is this kind of scope possible ? or not.... ( just using
2009 Apr 06
2
URL issue localhost/mongrel vs remote-server/apache
Hi all I have a small issue I ma trying to solve (at least to understand..) I am testing an app on my remote_server (w Apache/Passenger) in a sub_URI, without any problem (I tested also the same app, locally w Apache too) in my environment.rb , I have initialized config.action_controller.relative_url_root = "/my_subURI" config.action_controller.asset_host =
2009 Jun 28
2
validation error messages in Form - how to disable the ActionView::Base.field_error_proc ?
I wrote the following code in my form view : <li><label for="email">Email</label> <%= form.text_field :email, :size => "30" %> <span id=''email_error'' class=\''warning-text warning-text-indent\''><%= @user.errors.on(:email) %></span></li> the generated html code is the following : <span
2008 Jul 08
2
select helper still the worth thing in rails...
I have been trying all the day to make it happen, initial display is fine , but I cannot redisplay the selected value once the choice is done in my select helper I setup my slector in a helper (need to include the first option ''all'', as a prompt is displayed only once.... in my partial def company_role_selection(selection=nil) roles= [[''all'', 0]]
2011 Nov 15
4
Need some guidance on running shell commands from my app..
During execution in my Rails web app, I need to create a virtual host config on my Linux server, but I don''t know what would be the best way to do it , here are the steps ( my_domain.com is fixed, only my_subdomain is changing dynamically 1- create: /var/www/vhosts/my_domain.com/subdomains/my_subdomain/conf/ vhost.conf ServerName mysubdomain.mydomain.com .. content is always the
2009 Sep 10
2
undefined method `get_client_info' for Mysql:Class
after upgraded to Snow Leopard... (32bits arch) I re-installed the mysql gem (i386 architecture) , all gems and rails 2.3.4 testing in the console $ irb irb(main):001:0> require ''rubygems'' => true irb(main):002:0> require ''mysql'' => true Mysql.get_client_info NoMethodError: undefined method `get_client_info'' for Mysql:Class from
2009 Feb 09
2
dynamic constant assignment
I have a constant set up like that : ALL_LOCALES => {"it"=>"Italian", "fr"=>"Français", "de"=>"Deutsch", "en- GB"=>"English (UK)", "es"=>"Español (España)", "pt-PT"=>"Português", "pl"=>"Polski", "en-US"=>"English
2012 Jan 14
2
mysql2 error in production
As I need to upgrade a Rails app to 3.1 , I am trying to deploy it on a remote production server ( Linux Debian, after installing Rails 3.0.9 under rvm with all needed gems including mysql2 version 0.2.18 used by the app) after deployment, starting the app, I get a Load error w mysql2... ** [out :: www.mydomain.com] /var/www/vhosts/mydomain.com/rails/
2011 May 16
2
Cannot get multipart => true , running well in my form when using remote => true
I have a simple form , with a file field = form_for (Clip.new), :html => {:multipart => true} , :remote => true , do |f| = f.hidden_field :user_id, {:value => current_user.id} = f.text_field :name = f.text_area :description = f.file_field :image = f.submit I18n.t(:add) generating the html code <form accept-charset="UTF-8"
2010 Dec 25
7
I sit possible to write it in one line ? Array init + Array loading
I am always writing it in 2 lines : ( Array init then loading the array ) @providers = [] @authentications.map {|authentification| @providers << authentification.provider } Is there any Ruby writing for writing just one line ? thanks fyh -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,
2011 May 20
5
views w locale default template
[RAILS3] I hesitate on how handling the locale view templates to default to one language only .. sending admin emails will go only to one locale ''en_GB'' should I set it up into the template name and set I18n.locale to ''en_GB'' membership_renew.en_GB.html.erb OR whatever locale is used , if I have : membership_renew.html it will be the default ? --
2009 Jun 21
1
cannot do mass_assignment when inherited class ?
I got the following error when trying to create the elibrary instance (rdb:21) @elibrary = Elibrary.new(params[:elibrary]) RuntimeError Exception: Declare either attr_protected or attr_accessible for Elibrary, but not both. params : "elibrary"=>{"title"=>"bingo three", "short_description"=>"something new",
2009 Jul 01
2
Nested Forms - how to displayed the attributes content ?
I have a User model class User < ActiveRecord::Base has_one :account accepts_nested_attributes_for :account, :allow_destroy => true validates_associated :account attr_accessible :account_attributes is working fine, validating and updating both records (User and Account), but I caanot display the value in the form when is updated, ex: below the firstname is not displayed but
2009 Jul 20
1
CSS issue when using SubUri and Passenger
I am testing another application in local in my environment.rb I wrote config.action_controller.relative_url_root = "/elnino" config.action_controller.asset_host = "http://opticoaching.local" I defined correctly the vhost (I have already odne it for another app which is running well...) <VirtualHost *:80> ServerName opticoaching.local DocumentRoot
2010 Feb 23
1
how a js script can get the current locale from my rails app ?
I am not very fluent in JS, so I don''t see how to transfer the rails app current locale .. I have a JS script able to detect the default browser language .. running fine I can also modify the JS language, passing a global var .. // Create a JSON Object var myJSON = { "lang": "fr" }; // Pass it to the script immediately...
2010 Mar 11
1
bad url in js script
When running in development env, I don''t have this problem, only in production... I have a view in which a js script display a FlowPlayer video player (+ plugins)... the flash files are located in the /public/dist folder, ant the script calls them like that : <script> $f("player", "/dist/flowplayer-3.1.5.swf", { plugins: { rtmp: {
2011 Feb 21
1
Different renderings within the same format
I would like to write the same application for Facebook web app and Standard web users, but the Facebook layout is restricted, so I would have 2 html format layouts.... what is the best way to respond to html request from FB users and ''standard'' users on the web.. ? what I should test in the request to select the correct layout ? thanks for your feedback -- You received this