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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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 |
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
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
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
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
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.
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
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
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
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
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
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.
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
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
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
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,
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
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
Just in case anyone asked for the code.
It is simple:
--
Controller
class Admin::UsersController < ApplicationController
def new
@user = User.new
end
end
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
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
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
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
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
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/.
--~--~-~--~~~---~--~---
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
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
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
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
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
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/.
--~--~-~--~~
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
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
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
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
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
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
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
53 matches
Mail list logo