[Rails] Re: weird error in rails 2.3.5

2012-06-12 Thread Jamal Soueidan
I fixed the issue, it was related to override of name attribute in the model class. -- 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@googleg

[Rails] Re: weird error in rails 2.3.5

2012-06-11 Thread Jamal Soueidan
Colin Law wrote in post #1064039: > On 11 June 2012 14:58, Jamal Soueidan wrote: >> locations/location.html.erb >> >> <%=location.name%> >> <%=location.name%><%=location.name%><%=location.name%> >> >> name attribute only outputs one

[Rails] Re: Re: weird error in rails 2.3.5

2012-06-11 Thread Jamal Soueidan
Colin Law wrote in post #1064044: > On 11 June 2012 15:16, Jamal Soueidan wrote: >> >> it works. > > Could you please quote the previous message so that it easier to > follow the thread. Remember this is a mailing list not a forum > (though you may be accessing i

[Rails] Re: weird error in rails 2.3.5

2012-06-11 Thread Jamal Soueidan
Colin, I already tried that It's only outputting A and nothing else. but if I change to. <% @locations.each do |location| %> A <%=location.name%> B <%=location.name%> C <%=location.name%> D <%=location.name%> E <% end %> it works. -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] weird error in rails 2.3.5

2012-06-11 Thread Jamal Soueidan
Hello, I'm facing very simple weird error. in my main page main.html.erb <%=render(@locations) %> and in I try to output name twice locations/location.html.erb <%=location.name%> <%=location.name%><%=location.name%><%=location.name%> name attribute only outputs one time?? I cannot figure ou

[Rails] AWS::S3 access denied

2012-03-19 Thread Jamal Soueidan
Hello, I have a small issue with AWS::S3. I cannot list the objects in any buckets? I have setup a policy in the bucket. { "Version": "2008-10-17", "Id": "Policy1332206995246", "Statement": [ { "Sid": "Stmt1332206992416", "Effect": "Allow", "Principal": { "AW

[Rails] ajax submitting twice "very weird" 3.2.1

2012-03-01 Thread Jamal Soueidan
Hi, I have been using Rails for long time now and never faced this issue that ajax calls get's called twice and sometimes up to 5x times for weird reason. Started DELETE "/campaigns/26/segments/44" for 127.0.0.1 at 2012-03-01 11:10:20 +0100 Started DELETE "/campaigns/26/segments/44" for 127.0.0.

[Rails] Re: simple_form disable html5

2011-05-25 Thread Jamal Soueidan
No solutions :(? -- 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 rubyonrail

[Rails] simple_form disable html5

2011-05-24 Thread Jamal Soueidan
Hello, How do I disable html5 with simple_form gem? I tried to type: SimpleForm.html5 = false in environment.rb But this throws error. undefined method `html5=' for SimpleForm:Module (NoMethodError) Even though I see... module SimpleForm ... mattr_accessor :html5 @@html5 = true ... end

[Rails] simple net/http request encoding

2011-03-22 Thread Jamal Soueidan
Hello, Just simple example with net/http. url = URI.parse('http://www.bt.dk') req = Net::HTTP::Get.new(url.path) res = Net::HTTP.start(url.host, url.port) {|http| http.request(req)} p res.body Gives me ? ? ? ? on some danish characters. I have no idea how to get the right encoding with net/ht

[Rails] Re: formtastic issue

2011-02-08 Thread Jamal Soueidan
I switched to simple_form. It's simple and better :D -- 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

[Rails] Re: simple average question with mysql

2010-12-15 Thread Jamal Soueidan
Okay I had to point out AS something in the end of the SQL. Thanks for help everyone :D -- 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...@goo

[Rails] Re: simple average question with mysql

2010-12-15 Thread Jamal Soueidan
Okay I will do that when I find the correct SQL, then I convert the SQL to rails if this can be done :-) Thanks Tim for your SQL. But this gives me some weird error. select avg(url_count) from ( select count(url_id) as url_count, user_id from urls_users group by url_id limit 10 ); ERROR 1248

[Rails] Re: simple average question with mysql

2010-12-15 Thread Jamal Soueidan
and this one doesn't work either :( SELECT count(url_id) as url_count, avg(url_count), urls_users.* FROM `urls_users` limit 10; ERROR 1054 (42S22): Unknown column 'url_count' in 'field list' -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to t

[Rails] Re: simple average question with mysql

2010-12-15 Thread Jamal Soueidan
post #968673: > Jamal Soueidan wrote in post #968670: >> Hello, >> >> I know this might be out of rails question, > > Then don't ask it here. > >> but I could not find any >> other place to ask :D > > Apparently you didn't look very

[Rails] simple average question with mysql

2010-12-15 Thread Jamal Soueidan
Hello, I know this might be out of rails question, but I could not find any other place to ask :D select count(url_id) as url_count, user_id from urls_users group by url_id limit 10; +---+-+ | url_count | user_id | +---+-+ | 238 | 1 | | 3070 |

[Rails] Re: group_by user_id

2010-12-14 Thread Jamal Soueidan
With Rails or does sphinx handle the calculations all together? Anton Anykeyev wrote in post #968296: > you can use any function in group_by clause, for example you can write > something like > > your_record_collection.group_by{|zz| > function_returning_found_times}.each do |count_of_times, sub_c

[Rails] group_by user_id

2010-12-11 Thread Jamal Soueidan
Hello, I want to know if this is possible with sphinx. Let's say I have this table. id | user_id | title 1 1 sphinx 6 1 sphinx 2 5 sphinx 3 5 sphinx 4 4 server 5 1 great I want to g

[Rails] Re: Missing template home/index after update to Rails 3

2010-12-01 Thread Jamal Soueidan
adamwtw wrote in post #943033: > I noticed that if I rename the index.html.erb to index.en.html.erb, it > works. So I guess I should tell rails to use an "empty" locale when > looking for templates? > > Also, I'musing JRuby. > > Adam I actually have the same issue right now. Template is missing

[Rails] api respond_with json

2010-11-21 Thread Jamal Soueidan
Hello, So let say I created this class with the following method that responds to xml or json. class UsersController < ApplicationController::Base respond_to :html, :xml, :json def index respond_with(@users = User.all) end def create @user = User.create(params[:user]) respo

[Rails] update relation without id table

2010-11-04 Thread Jamal Soueidan
Why can't I update this row? >> cs = c.campaigns_segments.first => # >> cs.update_attribute(:sortable, 1) NoMethodError: undefined method `eq' for nil:NilClass from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.0/lib/active_support/whiny_nil.rb:48:in `method_missing' from /Library/Ruby/Gems/1.

[Rails] i cannot clear relation with rails 3

2010-10-28 Thread Jamal Soueidan
hi, im trying to update a relation through has many, but i cannot figure out how to do it, so i thought i can just delete all the relation and create them again, but i get error on clear method? >> c = Campaign.last => # >> c.campaigns_segments => [#, #] >> c.campaigns_segments.clear NoMethodErro

[Rails] Re: validates in rails 3 is fuzzy?

2010-09-23 Thread Jamal Soueidan
just in case.. i try to print out. <%= @user.errors.to_s%> i only get. passwordpassword_confirmation -- 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 rubyo

[Rails] validates in rails 3 is fuzzy?

2010-09-23 Thread Jamal Soueidan
Hi, I'm trying to create "forgot_password" page, but the error is not showing out on the page. user.errors[:password] = "must be longere then 5 character" or user.errors[:password] << "must be longere then 5 character" in html.erb <%= @user.errors[:password]%> but it's empty? nothing is prin

[Rails] Rails 3 routes admin section

2010-09-20 Thread Jamal Soueidan
Hello, I'm trying to re-create the old route to the new route method in Rails 3, but i cannot figure out how to do it. scope :admin, :name_prefix => "admin" do resources :accounts, :users end this doesn't give me "admin_controller" for "admin" path and not "/admin/accounts" path for th

[Rails] Re: Re: Re: formtastic options

2010-09-14 Thread Jamal Soueidan
radhames brito wrote: > sorry i meant to say > you can put normal tags in it i have and is works. i want to add more html to the select field. like to buttons to add and remove from the select field. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subsc

[Rails] Re: Re: formtastic options

2010-09-13 Thread Jamal Soueidan
radhames brito wrote: > sorry i thought you wanted to add some html options , but now that i > read > again i see you want to add more html to the output. Nobody knows how to create custom input field with formtastic. I thought this plugin was known around. -- Posted via http://www.ruby-forum.

[Rails] Re: formtastic options

2010-09-13 Thread Jamal Soueidan
radhames brito wrote: > :input_html =>{ options hash here } input_html is only for id, class...some html paramtere for input field. -- 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 t

[Rails] formtastic options

2010-09-12 Thread Jamal Soueidan
Hello, I'm looking at formtastic options but I cannot see how I can add some HTML beside the input field. I have select tag and I and to allow the visitor to add some text in it. Those buttons "add new text" should be below the select box. But I cannot see that formtastic allow you to add any H

[Rails] rails 3 gives me allot of issues?

2010-09-09 Thread Jamal Soueidan
Hello, Is there any configuration in Rails 3 since it destroy my HTML when i try to print something out ? Example: <%= navigation [{:users => admin_users_path}] %>
  • users
  • I have taken those from view source, why is this happening in Rails 3? I'm m

    [Rails] Re: Re: Re: Re: formtastic issue

    2010-09-09 Thread Jamal Soueidan
    radhames brito wrote: > try this > > <% semantic_form_for polymorphic_path([:admin, @user]) do |form| %> > <% form.inputs do %> > <%= form.input :name %> > <%= form.input :last_name %> > <%end%> > <% form.buttons do %> > <%=f.commit_button "OMG"% > <%end%> > <% end %> I just did [:admin,

    [Rails] Re: Re: Re: formtastic issue

    2010-09-09 Thread Jamal Soueidan
    radhames brito wrote: > did you put the = after <%? Yes. <% semantic_form_for polymorphic_path([:admin, @user]) do |form| %> <%= form.inputs %> <%= form.buttons %> <% end %> Another issue. http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Googl

    [Rails] Re: Re: formtastic issue

    2010-09-09 Thread Jamal Soueidan
    Thanks for answer radhames, I just tried it and it works. But now it doesn't print out the input fields, only the button on the bottom? -- 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

    [Rails] Re: formtastic issue

    2010-09-09 Thread Jamal Soueidan
    Just in case anyone asked for the code. It is simple: -- Controller class Admin::UsersController < ApplicationController def new @user = User.new end end

    [Rails] formtastic issue

    2010-09-09 Thread Jamal Soueidan
    Hello, I will try to explain it step by step :-) I just created a new rails 3 app, then I created a new controller... rails generate controller admin::users I didn't forget to add the resources in the routes.rb file like this. namespace :admin do resources :users end Now I try to use formta

    [Rails] Re: Rails app on EC2

    2010-01-29 Thread Jamal Soueidan
    Engine Yard. They handle the notification when instance die and create another one for you with all the data it needs? Conrad Taylor wrote: > On Fri, Jan 29, 2010 at 1:12 PM, Jamal Soueidan > wrote: > >> Hello, >> >> I'm thinking to move my app to ec2, but

    [Rails] Rails app on EC2

    2010-01-29 Thread Jamal Soueidan
    Hello, I'm thinking to move my app to ec2, but Im reading that amazon does not guarantee that my instance doesn't die? So my question how can people use it for rails, and what does they do when the amazon ec2 instance dies? Do we have any automatic job to get new instance and get the app up and r

    [Rails] Re: OR conditions on has_and_belongs_to_many?

    2009-09-16 Thread Jamal Soueidan
    I know I can do it with LIKE :) -- 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@googlegrou

    [Rails] OR conditions on has_and_belongs_to_many?

    2009-09-16 Thread Jamal Soueidan
    Hi, I wonder how I can insert "OR" in has_and_belongs_to_many conditions? Code: has_and_belongs_to_many :projects, :conditions => ["projects_users.user_id = 0"] Console: user.projects SQL: Project Load (0.3ms) WHERE ("projects_users".user_id = 1 AND (projects_users.user_id = 0)) I won

    [Rails] Re: setup has_many routes

    2009-09-15 Thread Jamal Soueidan
    Well, that wasn't hard :-D map.namespace :admin do |admin| admin.resources :projects do |project| project :tasks, :collection => {:assigns => :post} end admin.resources :tasks end -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~---

    [Rails] setup has_many routes

    2009-09-15 Thread Jamal Soueidan
    Hi, I'm trying to accomplices this with REST :) http://localhost:3000/admin/projects/11/tasks/assigns/:user_id This is my route config. map.namespace :admin do |admin| admin.resources :projects, :has_many => {:tasks => {:assigns => :post}} admin.resources :tasks end But I'm not get

    [Rails] Re: empty all cache???

    2009-08-24 Thread Jamal Soueidan
    Weird .. Now it's gone when I logged out of the current user. :S:S -- 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

    [Rails] Re: empty all cache???

    2009-08-24 Thread Jamal Soueidan
    then I tried. >> Rails.cache => # >> Rails.cache.clear => {} >> Rails.cache => # This did not get me anywhere. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rai

    [Rails] Re: empty all cache???

    2009-08-24 Thread Jamal Soueidan
    and now I tried. * rake tmp:cache:clear did not work either. -- 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

    [Rails] empty all cache???

    2009-08-24 Thread Jamal Soueidan
    Hi, I just made a mistake to cache the index action and now I cannot figure out how to delete it? I have tried the following. * restarted server * set perform_caching to false * changed port * changed cache store to different ports and file path. * tried to expire_page :action => :index * tried

    [Rails] Re: how to create when attr_protected?

    2009-08-12 Thread Jamal Soueidan
    So I must do something like this then for now... @user = session[:user] @user.postal = params[:user][:postal] @user.birthday = params[:user][:birthday] @user.save Just to be 100% sure that no one can update anything else :) -- Posted via http://www.ruby-forum.com/. --~--~-~--~~

    [Rails] Re: how to create when attr_protected?

    2009-08-12 Thread Jamal Soueidan
    Frederick Cheung wrote: > On Aug 12, 9:47�am, Jamal Soueidan > wrote: >> Hello, >> >> I'm facing a small issue here with protected columns from being updated. >> (email, username) >> >> So I thought attr_protected is the solution, but this dest

    [Rails] how to create when attr_protected?

    2009-08-12 Thread Jamal Soueidan
    Hello, I'm facing a small issue here with protected columns from being updated. (email, username) So I thought attr_protected is the solution, but this destroy my creation of user? I cannot assign email when creating new user? How do I solve this small issue? -- Posted via http://www.ruby-for

    [Rails] Admin controller

    2008-11-11 Thread Jamal Soueidan
    This is very weird behavior for rails. 1. When I visit my app http://localhost:3000/admin/base/login class Admin::BaseController < ApplicationController def login render :text => "running" end end 2. but when I go here http://localhost:3000/ I get error because login.html.erb not foun

    [Rails] Re: X is not missing constant Y

    2008-10-30 Thread Jamal Soueidan
    Roy Pardee wrote: > Well don't leave us hanging--how'd you fix it? ;-) Sorry, I went home from work before but now I'm online again. class Blog::Post < ActiveRecord::Base belongs_to :category end class Blog::Category < ActiveRecord::Base has_many :posts end Error: Blog is not missing cons

    [Rails] Re: X is not missing constant Y

    2008-10-30 Thread Jamal Soueidan
    Ryan Bigg wrote: > It would be better if you explained what X and Y were and how they > relate to each other. Could you please do that for us? Thanks. It's fixed :) Thanks. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message

    [Rails] X is not missing constant Y

    2008-10-30 Thread Jamal Soueidan
    Moving my app from rails 1.2 to rails 2.1, I stuck into this weird problem? X is not missing constant Y. The problem occurs when I use the join table association. X.find(1).y It works in (script/console) but not in browser? Anyone have any experience with this issue? -- Posted via http://www

    [Rails] Blog::Post(Table doesn't exist) ?

    2008-10-30 Thread Jamal Soueidan
    Well, it's as simple as the subject says :) Why does... class Blog::Post < ActiveRecord::Base end ...use "posts" table and not "blog_posts"? even though migration file has created... create_table blog_posts do |t| .. end I checked the "db" file and blog_posts is created :) -- Posted via htt