Displaying 20 results from an estimated 30000 matches similar to: "validates, what's wrong?"
2011 Jan 11
9
Can I omit respond_with.
If I don''t want xml results but only html can I omit respond_with in
some actions?
For example index from:
respond_with(@sectors = Sector.all)
becomes only
@sectors = Sector.all
isn''t it?
--
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
2010 Dec 25
6
undefined local variable or method?
I have:
<%= form_for(@supplier) do |f| %>
.......
......
<%= render ''sector_categories'', :locals => {:f => f} %>
in _sector_categories partial I have:
<div class="field">
<div id="category_update">
<% for category in @categories %>
<%= f.check_box :category_ids[], category.id,
2011 Jun 19
10
validates_numercality_of with allow_nil.
In the model I have:
validates :square_meters_public_land, :barrier_meters, :numericality
=> { :greater_than_or_equal_to => 0 }, :allow_nil => true
but if, in the field, on create, I don''t insert a value I have the
error "field is not a number".
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2011 May 28
4
how can I investigate when a rspec test fails?
For example:
it "re-renders the ''new'' template" do
# Trigger the behavior that occurs when invalid params are submitted
Sector.any_instance.stub(:save).and_return(false)
post :create, :sector => {}
response.should render_template("new")
end
I have the new template under app/views/sectors but the test says:
SectorsController POST
2012 May 10
6
Is it suitable using STI?
I have problems on a simple design problem.
I have many companies. Each company have one or more commercial activity.
Activities types are: ecommerce, local unit, television, automatic
vending machines, and so on.
Company may have one or more ecommerce activity or one or more local
unit activity, one ormore vending machines, etc.
How can I model this scenario?
Company has_many ecommerce has_many
2006 May 18
8
Concatenated key
Hi all,
I started playing a couple days ago with Rails and it find it very
interesting.
But I''m a bit stuck with making it work with a concatenated primary key.
I want to use my own names for the DB fields and I''m using SQL Server
2005.
My tables look roughly like this:
CREATE TABLE USERS (
USR_ID VARCHAR(25) NOT NULL PRIMARY KEY,
USR_PASS VARCHAR(25)
)
CREATE TABLE
2011 Nov 12
3
complex form with dynamic fields.
I''ve seen http://railscasts.com/episodes/73-complex-forms-part-1,
part2 and part3.
It seems to be my case.
I have:
Company
has_many :documents
has_many :tenders, :through..........
and
Document
belongs_to :company
Tender
has_many :companies, :through..........
I want to insert documents and tenerds on company creation.
If documents are more than one the user can click "add
2012 Nov 26
8
why functional test does not get failure?
The test:
test "should get new" do
get :new, :room_id => @room.name
assert_template(:ne)
end
the template new does not exists but the test does not get failure.
Why?
--
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
2011 Jun 15
5
rails 3.0.9
Today was expected the new stable rails release 3.0.9 with some fixed,
among all the problem with escape_javascript.
It seems that it see that has not been released, unfortunately.
--
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
2011 Jan 08
9
options_for_select.
Even reading the documentation I can not figure out what is the
select_tag difference between this:
<% = select_tag (bags [], "options_for_select (bags.collect @ {| bb |
[bb.bag_type, bb.id]},
ruser.bags.collect @ {| ub | ub.id}), {: multiple => true,: id =>
"bags"})%>
and this:
<% = select_tag "bags [], " options_for_select (bags.collect @ {| bb
2005 Dec 12
2
count sql failing with unknown table....
Hey Rails People,
I''m doing my first Rails app and I''m having a newbie problem with the
count method....
Mysql::Error: #42S02Unknown table ''jobs_sectors'' in where clause: SELECT
COUNT(*) FROM jobs WHERE (jobs_sectors.sector_id = 1 )
Extracted source (around line #4):
1: <div class="sectors">
2: <ul>
3: <% for sector in @sectors
2011 Feb 10
7
upgrade leny-squeeze, xen3.2-xen4.0, what''s wrong?
I am running a Debian Squeeze Xen 4.0.1 Hypervisor and 2.6.32-5-xen-amd64 dom0.
My xen-tools.conf:
lvm = vg00
size = 100Gb # Disk image size.
memory = 2048Mb # Memory size
swap = 2G # Swap size
# noswap = 1 # Don''t use swap at all for the new system.
fs = ext4 # use the EXT3 filesystem for the disk image.
dist = `xt-guess-suite-and-mirror --suite` # Default
2011 Sep 26
2
how to convert from xen .cfg files to libvirt xml?
I have a .cfg configuration file for a xen virtual machine.
I need to convert it in xml format to use with libvirt.
So I run virsh domxml-from-native xen-xm backupsrv.cfg but I have an error:
error: Unknown failure.
How can I investigate about the error?
2011 Feb 11
1
accept_nested_attributes, reject_if doesn't work.
class Post < ActiveRecord::Base
validates :name, :presence => true
validates :title, :presence => true,
:length => { :minimum => 5 }
has_many :comments, :dependent => :destroy
has_many :tags
accepts_nested_attributes_for :tags, :allow_destroy => :true,
:reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? or v.nil? } }
end
rails c
2012 May 03
3
inheritance with rails.
Hello.
I''ve read about examples on inheritance with rails.
Here is an example:
http://juixe.com/techknow/index.php/2006/06/03/rails-single-table-inheritance/
The way is to add a type field in the table.
So if I have an Animal class with an attribute name, I can inherit
from this class like:
Dog < Animal, Cat < Animal, and so on.
With the type field in the table I can do Dog.all,
2009 Sep 18
36
streaming server on a virtual machine.
I need to installa a streaming server for live videos and for video on demand.
My choice is red5.
Do you think I can use a xen virtual machine to run a streaming service?
Or it is better not to virtualize?
Sorry for my bad english.
_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
2010 Sep 13
13
what I've missed in routes.rb?
In routes.rb I''ve put:
resources :sessions
controller is:
class SessionsController < ApplicationController
def destroy
session[:id] = nil
session.delete(:casfilteruser)
CASClient::Frameworks::Rails::Filter.logout(self)
end
end
In application.html.erb I have:
<%= link_to ''Logout'', session_path(session[:cas_user]), :method => :delete %>
I
2013 Feb 05
2
project proposal.
Hello.
There is someone interested to a collaboration in developing a project
to manage commercial activities?
The target is to learn more on grails and develop an useful application.
--
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
2011 Jul 25
1
3 models in a form.
Hello,
class Customer < ActiveRecord::Base
has_many :deliveries
class Delivery < ActiveRecord::Base
has_many :delivery_items
has_many :products, :through => :delivery_items
belongs_to :customer
class DeliveryItem < ActiveRecord::Base
belongs_to :delivery
belongs_to :product
I create a new delivery for customer x:
= simple_form_for @customer do |f|
= f.simple_fields_for
2011 Mar 26
2
upload file, read first 10 lines.
I have a csv file and in my controller:
uploaded_file = params[:upload][:csv].read
@rows << FasterCSV.parse(uploaded_file)
I want to put in @rows only the first 10 lines but the read method
reads all the file.
How can I do?
--
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