Displaying 20 results from an estimated 2000 matches similar to: "Failure in comparisons"
2008 Jul 07
3
How to get a users screen name into a hidden field in a PostsController action?
Instead of the user entering a name, I want to pass their screen name
along with supplied :title and :content fields. here is what I''ve
got..
f.hidden_field :author, user.screen_name
here is the create method from Posts controller:
def create
@title = "Gravity"
@user = User.find(params[:id]) # this does not work, and I don''t
know why
if request.post?
2011 May 16
2
Cannot get multipart => true , running well in my form when using remote => true
I have a simple form , with a file field
= form_for (Clip.new), :html => {:multipart => true} , :remote =>
true , do |f|
= f.hidden_field :user_id, {:value => current_user.id}
= f.text_field :name
= f.text_area :description
= f.file_field :image
= f.submit I18n.t(:add)
generating the html code
<form accept-charset="UTF-8"
2006 Jul 08
4
Hidden fields in forms
Please can someone show me the correct syntax for a hidden field in
forms, this is my code
<%= start_form_tag :action => ''create'' %>
<div class="form1">
<table width="auto" boader="8" cellspacing="5" cellpadding="5">
<% hidden_field ''line_item'', ''client_id'', :value
2006 Jul 17
4
Division not working!?!??
I guess you could call this a noobie problem as well. I''m trying to
divide two numbers by each other...
For example:
<% for element in project.elements %>
Element: <%= horizontal_bar_graph [element.name,
((element.completed_hours / element.hours) * 100)] %><br />
<% end %>
element.completed_hours == 2
element.hours == 5
(2 / 5) * 100 == 40
However,
2006 Jun 04
3
passing a value in a hidden field inside a form
should be trivial but I can''t figure this out from api
<%= hidden_field ''certifications'', ''personnel_id'', {value =
#{@personnel.id}} %>
I want to pass the value of ''id'' field in my form to the certifications
controller as personnel_id
Craig
2006 Mar 05
1
Help with Self-Referential HABTM
With the help of the Rails Recipes have got a self-referential HABTM
relationship working, but I''m really struggling with getting a new entry
from a form accepted. i should say here that the form is also submitting
info for the join table too.
So in my model I have:
class Type < ActiveRecord::Base
has_and_belongs_to_many :subtypes,
:class_name => ''Type'',
2006 Aug 07
2
related to forms
I''m trying to construct a form that would request a page using GET and
would like my variables to be simple like q,v, etc so that the URL it
calls is something like: /controller/action?q=80&v=100
However, I''m having trouble using the basic form helpers (probably doing
something wrong) cos expressions such as:
<%= hidden_field "q", "v", {:value
2006 Jul 02
6
remote form w/ evalScripts:true
Hello. I want to select an item from a select list and have that
result in an ajax call that updates two sections on the page. Here is
the code in the controller
def create
...
render :update do |page|
page.replace_html ''list_items'', :partial => ''lists/list_items''
page.replace_html ''add_item'', :partial =>
2006 Mar 17
1
How to update values in database in this form?
Hi,
This is my rHtml page & Corresponding actions & model pages:-
===listform.rHtml=================
<h1>Products List</h1>
<%= start_form_tag(:action => "add_to_cart")%>
<table>
<tr>
<%
i=0
%>
<th>
Product No.
</th>
<th>
Unit Price
</th>
<th>
Available Qty.
</th>
<th>
Demand Qty.
</th>
2006 Apr 05
3
how to insert Current DateTime value into database?
Hi,
I want to insert onto database the Current DateTime Value into database
field "Store_date" with datatype (DATETIME). How to do tihs?
I am usiing hidden variable into my form as follows:-
=======================
<%= hidden_field("store", "store_date", :value =>:datetime ) %>
=======================
But when I m submmittng form I couldn''t find
2012 Sep 08
4
dash symbol
In the example below, what is the dash doing between the class
attribute and array:
(field_helpers -
[:label, :check_box, :radio_button, :fields_for, :hidden_field, :file_field]).each
do |selector|
--
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
2007 Sep 22
1
Rails newbie: passing a value to hidden form field, then getting it
Warning: I am as green as #00FF00 with rails :-)
I have an rhtml view that shows a survey: /views/survey/show.rhtml. I
have a Survey model, helper and controller. I''m using the
acts_as_commentable plugin to collect comments, and trying to save
user comments from users who have taken a survey (don''t ask -- it''s
just a test).
To save the comment, I need the id of the
2006 Jun 07
1
Upload to DB hang mentioned in wiki
I''m uploading files to a mysql database, using a mediumblob size.
Following the wiki here:
http://wiki.rubyonrails.org/rails/pages/HowtoUploadFiles ,
I got past the first mysql 500kb limitation with the max_allowed_packet = xM
trick, setting it to 1000M.
However, as the person at the very bottom of the wiki notes, I too cannot
upload more than around 10mb.
I also tried the suggested
2010 Nov 09
3
help getting started with javascript generated forms
How does one generate a form within a view using javascript?
Specifically, assume views/premise/new.html.erb looks like this:
<%= form_for(Premise.new) do |f| %>
<%= f.hidden_field :full_address, :value => $FULL_ADDRESS %>
<%= f.hidden_field :geocoding, :value => $GEOCODING %>
<%= f.submit :value => "use this address" %>
<%= f.label
2010 Apr 12
3
$(link).previous("input[type=hidden]") is undefined
I am getting this error when trying to use the remove link explained
in the Railscast:
http://railscasts.com/episodes/197-nested-model-form-part-2
error:
$(link).previous("input[type=hidden]") is undefined
remove_fields()applic...1065175 (line 6)
function onclick(event) { remove_fields(this); return false; }()1
(line 2)
[Break on this error]
2008 Apr 10
3
Custom Form Builder Help
Hello All,
We use a different custom form builder for our app, but I wanted to
use facebooker''s typeahead widget in side the other form builder.
I don''t know much about form builders, but I created a file in lib/
doing this:
http://pastie.caboo.se/178776
It works great, except that the id''s and class names get messed up.
Instead of school_name, I get
2007 Sep 06
2
Wordpress Javascript Index Loop
I want to use javascript to display the categories that the post is
filed under when a icon/image is clicked. The list of categories
should expand at the bottom of the post under the icon(s).
This works great on the single post page, but the index (main) page
lists 10 posts, and it will only work on the first post. No matter
what post icon is clicked the first post expands. I think I
understand
2006 Feb 07
3
Creating a new object with a passed in parent?
I have a simple object, Article, which has_one :parent of the same time.
On my Show page for a given article there will be a "new child" button
which will pass the current :id (or the current Article itself) to the
new form. What is the proper way to hide a reference to this parent in
the form so that when it is submitted back, the create method knows what
to do with it?
2005 Feb 09
1
cant map foreign key in list view
Hi
I have been struggling to get a foreign key in a list map to a readable
value in a lookup table
I have a list of projects and each project has a project_manager.
Project.rb
class Project < ActiveRecord::Base
has_one :project_manager, :class_name => "Users", :foreign_key =>
"manager_id"
end
The association above sais that a project_manager is in
2013 Nov 10
3
accepts_nested_attributes_for how, example
I have following tables with following models:
users(id, role_id) *has_many :entries*
categories(id, category_name) *has_many :entries*
entries(id, category_id, user_id) *belongs_to :user, belongs_to
:category, has_one :storage*
storages(id, title, content, entry_id)* belongs_to :entry*, *has_one
:vote*
votes(id, count, storage_id) *belongs_to :storage*
Now,