Displaying 14 results from an estimated 14 matches for "afxetdrqm".
Did you mean:
afxetdrqme
2008 Apr 07
7
Saving attribute
Something is getting lost here.
def create
@home = Team.find_by_user_id(current_user.id)
for player in @home.players
player.update_attribute(:game_id, @game.id)
end
end
def show
@players = Player.find_all_by_game_id(params[:id])
end
view
<%= @players.size %> # mistakenly equals zero
Played with the console and everything should be working fine...
2009 May 27
9
Contingent Select Boxes - 2 Q's
I have a form with contingent select boxes (the state is contingent on
the country selected, so when the country selected changes, the state
changes -- I am using the Carmen plugin for getting my state names and
country names together, but not the functionality I am interested in
achieving).
Everything works fine except I cannot figure out how to amend my code
such that:
A. When the form is first
2008 Apr 15
4
ActiveRecord::StatementInvalid in BlogController#index
Hello. I''m trying to do the video tutorial "how to build a blog engine
in 15 minutes with ruby on rails" from the main rubyonrails website,
and I''m getting an error when I try to use scaffold :post after
editing my config file for the mysql database.
Here is the exact error I''m getting:
ActiveRecord::StatementInvalid in BlogController#index
2010 Nov 25
4
Devise sessions and load-balanced/multiple servers
Hi
Hoping someone has had experience with this or can tell me where to
start investigating.
I''ve got a Rails app with Devise authentication running on a server
cluster behind a load balancer, so requests to the website will
alternately hit one server, or the other. My problem occurs when I try
to register a new user. Everything goes fine, I get the confirmation
email, I click the link,
2005 Sep 10
4
has_too_many
Assuming you have Person that has_many :messages, what will it happen if it
has 10000 messages?
Will rails attempt to initialize @person.messages with 10000 rows from
database? If that is the case, is combining finder_sql and counter_sql the
common practice to avoid this?
Bogdan
_______________________________________________
Rails mailing list
2008 Apr 10
3
option_groups_from_collection_for_select with a ActiveRecord::Base single object
Rails documentation gives examples of using
option_groups_from_collection_for_select with two tables/objects.
How could it be done with one?
Example that almost works:
I have a form to enter address from both the United States and Canada.
It has the following:
====new.html.erb====
<%= select_tag(
:state,
option_groups_from_collection_for_select(
State.countries,
:country,
2009 May 27
12
query on Ruby array
Looking for suggestions on following two queries.
Query 1
------------------------------
Are the two following lines of code different in Ruby / Rails ( in a
*.html.erb) file.
<% if @forms.count != 0 %> <!-- first code -->
Vs.
<% if @forms.count %> <!--second code -->
@forms is an array of objects. Coming from "C" language development
background, i thought
2008 Apr 02
9
Problem getting the most recent has_many associated object
I can''t get my view to display the most recent parameters from an
associated object in a view... here is a birds-eye of my app:
I have two models, Ferms and Kinetics. Ferm has_many :kinetics,
Kinetic belongs_to :ferm. Kinetic has the fields ferm_id, brix and
temp.
In my ferms/index view I have a table listing the attributes of each
ferm instance. I would like to display the most recent
2009 May 05
4
modalbox rails var interpolation
Howdy everyone.
I am using modalbox which is very nice an easy to use. I have this
for an edit for a company listing:
<td><%= link_to(''Manage Companies'', {}, :onclick => ''Modalbox.show(\''/
companies/edit/#{company.id}\'', {width: 600}); return false;'') %></td>
The link is not putting the company.id in it puts #{
2008 May 09
5
dynamic models
Hi
In my app , a user can create a set of question then a table is
dynamily created , in the database,to store the answers of the
questions. the name of the table is answers_x (x is the id of the
questionniare).
Is it possible to dynamicly create a model, to handle the answer_x
tables ?? I can''t manually create a model then restart the server.
2009 May 25
2
CAn u please tell wats the prob in runnning my project?
[~/kallori]# rake db:migrate
(in /home/gm/kallori)
no such file to load -- hmac-sha1
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require''
/home/gm/kallori/vendor/rails/activesupport/lib/active_support/
dependencies.rb:510:in `require''
2005 Aug 28
6
ActiveRecord Question
Hi all
I am new to Rails, and obviously I''m missing something, I''ll get straight to the question:
A User has many operations (granted to her), each Operation is associated with an OperationType. Each Operation may be associated with more then one User.
So the model goes like this:
class User < ActiveRecord::Base
has_and_belongs_to_many :operations
2010 May 05
6
form remote tag :before=> function problem
Hi I have a strange problem, I am using the below code
form_remote_tag :url => ''/abc/test'',:before => "return hello();",
:update=>''test_categories'' ,:complete => "Element.hide(''spinner'')",
:loading => "Element.show(''spinner'')" do
I am using :before=> function to validate the
2005 Sep 11
3
Extending ActiveRecord::Base
Hey everyone,
I''m interested in extending ActiveRecord::Base. I have a special
"easier" find function that I want to include in all classes.
How can I include this in all classes?
Can I just create a model object that does something like this:
class ExtendedAR < ActiveRecord::Base
def self.special_find
...
end
end
and then all my other classes