Displaying 20 results from an estimated 90 matches similar to: "collection_select default selected value"
2005 Oct 26
1
Re: collection_select question about selected_value
Paul Welty wrote:
> collection_select(:client, :company_id, @companies, :id, :name, {
> :selected_value => 2 , :prompt => "Please select a company..." })
>
> Returns a functioning SELECT element, but it won¹t select the second item.
> (BTW, using the selected_value as a string doesn¹t work either)
>
> Am I doing something wrong, or is this impossible?
>
2006 Mar 30
3
Rails 1.1, Markaby, options_from_collection
Last night, I upgraded one of my rails apps to 1.1. This app uses
Markaby exclusively for its'' views, and once I checked out the latest
revisiong of Markaby (r33), everything was working fine except for one
thing:
select_tag(''province_id'', options_from_collection_for_select(@provinces,
"id", "name"))
Now returns this (as you see it is spitting
2008 Jun 25
2
R 2.7.1 und WinEdt (PR#11806)
Hi,
under the new version R 2.7.1 I can't use WinEdt. It seems that there is
a bug in that version. To use older versions of the package RWinEdt
doens't bring success. The Use of R 2.7.0 doesn't cause that Problem.
Regards,
Hans-J?rgen Auinger
--
----------------------------------------------
Hans-J?rgen Auinger
Lehrstuhl f?r Pflanzenz?chtung
Wissenschaftszentrum Weihenstephan
2010 Jun 17
1
Problem with options_for_select
Hi,
I have a problem with the form select. In the value field I have the
generated html...
<%= f.select :brand_id,
options_for_select([[''Brands'', 0]] +
@search_brands.map { |b| [b.name, b.id]}),
{:id => ''cbxBrand'', :tabindex => (@tabindex += 1)} %>
This is the html:
<select name="search[brand_id]"
2006 Jun 14
5
InstantRails Lost connection to MySQL server
Hiall,
I just tried out InstantRails version 1.3a. After a virgin install and
filling the fresh mysql db with my app schema, I tried runningthe app
with webrick, only to see the infamous "Lost connection to mysql
server" for every action. What is it that I''m doing wrong? I also have
mysql 5 installed on my machine, but the service is stopped while
experimenting with
2006 May 01
7
ActiveRecord and Database Views
Hiall,
If I have say 10 tables that i would like to wrap up in 1 view to
manipulate data inside these tables, do I then need 10 model.rb files
for all 10 tables plus 1 for the view, or do I just need 1 model.rb
file for the view ?
cheers
Martin
2006 May 18
6
Form actions with additional parameters
Hiall,
I want to give the action of a form an additional parameters but can''t
figure out how to do it. My code looks like this
<%= start_form_tag :action => ''create'', next_step => true %>
<%= render :partial => ''user_form'' %>
<%= render :partial => ''community_form'' %>
<%= submit_tag
2006 May 09
3
Named link to image
Hiall,
Call me stupid if you like .,) but it seems i can''t figure out how to
get a named link using a combination of link_to and image_tag. What I
need is basically a link displaying a name along with some image to
indicate status (open,working,finished). I found no combination of
link_to and image_tag that accepts a name, this seems to be solely
used for making whole images into links
2006 May 14
6
file and directory layout below app/models
Hiall,
Is it possible to organize my model files below app/models into
subfolders? E.g. I would like to put admin related models into their
own subfolder. This kind of structuring works for controllers and
views (scaffolding creates the right subfolder-model mappings), but
app/models always stays flat. I''d really like to be able to group my
code into logical, well packages :-) Yes, I
2010 Sep 17
1
option_groups_from_collection_for_select
Hi,
in my development environment (Ruby 1.87, Rails 2.3.8) the following
code works fine:
<%= select "applicant", "member_1",
option_groups_from_collection_for_select(@topics, :members, :topic, :id,
:name, @applicant.member_1), {:include_blank => true} %>
Producing:
<optgroup label="Clinical Neuroscience">
<option value="1">Prof
2006 Jun 12
6
Storing "money" in databases
Hiall,
I''m wondering what''s common practice when dealing with money values
stored in databases. I like the idea of storing all the values as
integers, i.e. all the values in eurocents not euros. Then I need to
multiply all values the users enter by 100 before storing them in the
database. Now the question is, what''s the most efficient and dryest
way to do this?
2006 May 14
4
script/console on windows
Hiall,
When I try to run script/console from a windows command line like
f:\rails_app\ruby script\console
I get the following error:
F:/Programme/Ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__'': no such file to load -- initializer (LoadError)
from F:/Programme/Ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require''
2006 May 18
3
ActiveRecord after save new and old values
I want to write a function that after an ActiveRecord saves
successfully, can show me what the before and after values of a
particular column are. Is this possible without creating a separate
object before modifying the current one?
-John
2006 May 10
8
dynamic setting of username and password in database.yml
Hello
I''ve now read a lot about application-level authentication in Rails, but
I need to do database-level authentication.
The reason is that my database needs to have the current_user (database
current_user, not current_user defined in an ActiveRecord Model) set to
execute triggers for automatically updating audit tables. So it is not
enough to have a session check against a User
2006 May 17
1
Experiences with ModelSecurity
Hiall,
I would be very interested in your opinions on the ModelSecurity
plugin by Bruce Perens.
http://perens.com/FreeSoftware/ModelSecurity/Tutorial.html
Some time ago, I read on a few pages that it is the way to go, on this
list however, I didn''t read much about it. Apart from it''s security
level,
quoted from comments in source code:
# FIX: At the moment we only support
2006 Apr 27
5
Realtime Form Validation Plugin Available
Granted, I''m still very much a newbie, but after reading an article on AJAX
that basically states at one point that just because you can use AJAX
doesn''t always mean you should, I have to ask: Why bother contacting the
server (even if it is an insignificant amount of bandwidth) to validate the
sanity of form data (unless you''re actually validating against something in
2006 Apr 18
7
Connecting to multiple databases
Hi Everyone,
I am trying to connect to multiple databases and followed along the
Recipe in Chad Fowlers ''Rails Recipes'' book (which basically is about
establishing the connection in a subclass of ActiveRecord::Base, and
inheriting all classes in need of this connection from this class)
Chad Fowler says:
"You won''t be able to instantiate an External, of course,
2006 May 18
4
Can I send rendered .html to somewhere besides the web server?
Is there any way to tell Rails to send the .html file it renders somewhere other than the web server? I need to save a page to the server''s file system instead of sending it to the user''s browser.
Thanks!
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060518/facce47e/attachment.html
2006 Jun 11
6
page.update_html not executed
Hi,
when doing:
render :update do |page|
page.replace_html ''suggested_contractors'', :partial =>
''contractors''
page.visual_effect :highlight, ''suggested_contractors''
end
I got js as output, it is not executed, return html *contains*:
try { Element.update("suggested_contractors", "
\n 12345678910\n
\n
2006 May 23
3
image_tag problem
Hiall,
I want to make an image_tag from within a controller in order to be
able to present a link (with a status image) in a view. Here is my
controller method (in file webca_controller.rb, hence WebcaController)
def untouched_status_image_tag
image_tag("open", { :alt => "Offen", :title => "Offen", :size =>
"12x12", :class =>