search for: hidden_field

Displaying 20 results from an estimated 87 matches for "hidden_field".

2006 Jul 08
4
Hidden fields in forms
...ne 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 => session[:client_id] %> <% hidden_field ''line_item'', ''product_id'', :value => 999999 %> <% hidden_field ''line_item'', ''sort_key'', :value =&g...
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 Jul 12
7
Failure in comparisons
I''m basically a Ruby noobie. At the moment I''m having a fair bit of trouble trying to figure out what''s going wrong here (partial template): <%= @project = Project.find(@the_id) if current_user.userid == @project.client hidden_field ''messages'', ''recipient'', ''value'' => @project.project_manager else hidden_field ''messages'', ''recipient'', ''value'' => @project.client end %> The current_user.userid meth...
2006 Aug 07
2
related to forms
...ld 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 => "xyz"} %> results in something like: query?q%5Bv%5D=xyz I think I''m missing something somewhere.. Cheers Mohit.
2006 Jul 02
6
remote form w/ evalScripts:true
...#39;' end end Here is the version of code in the template that I WANT to use to POST to this action: <%= form_remote_tag :html => { :action => url_for(:controller => "list_item_links", :action => "create") }, :eval_scripts => true %> <%= hidden_field ''list_item_link'', ''list_id'', :value => @list.id%> <%= hidden_field ''list_item_link'', ''list_item_type'', :value => ''List'' %> Which list? <%= select ''list_item_link'', ''...
2006 Mar 05
1
Help with Self-Referential HABTM
...ny subtypes and belong to many types to -- hence needs to be many-many rather than a tree structure): <%= start_form_tag :action => ''createsubtype'', :id => @type %> <%= render_partial ''form'' %> # Gets all the info for the Type fields <%#= hidden_field(''type'', ''subtype_id'', "value" => @subtype.id) %> <%= hidden_field(''subtypes'', ''id'', "value" => @subtype.id) %> <%= submit_tag ''Create'' %> <%= end_form_tag %> In...
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? and params[:post] if new flash[:notice] = "Commen...
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email...
2006 Apr 05
25
How to avoid bunch of <% %> ??
Hello, I would like to know is there is a way to avoid poluting the views with tons of <% %> ? Like this <%= start_form_tag() %> <%= text_field_tag(''category[title]'', category.title, {:size => 20, :maxlength => 128}) %> <% if not category.parent_id.nil? %> <%= select("category", "parent_id", Category.find(:all,
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 entry in store_date field. How to do this using hidden variable? Please help me. Prashant -- Posted via http://www.ruby-forum.com/.
2007 Sep 22
1
Rails newbie: passing a value to hidden form field, then getting it
...hich is gone when the user hits the submit button to save their comment. So I am just trying to save the survey id in a hidden field associated with the form. In the show.rhtml, I have: <% form_for :comment, @survey, :url => { :action => :save_comment } do |form| %> <%= form.hidden_field "survey", "#{@survey.id}" %> ... <% end %> Which results in "ActionView::TemplateError (undefined method `merge'' for "1":String)". 1 is the id of the survey, so I am close. I tried numerous variations of passing values via form_for...
2006 Mar 17
1
How to update values in database in this form?
...on => "add_to_cart")%> <table> <tr> <% i=0 %> <th> Product No. </th> <th> Unit Price </th> <th> Available Qty. </th> <th> Demand Qty. </th> </tr> <% for product in @products %> <tr> <td> <%=hidden_field ''product'',''product_id''+i.to_s, :value=>product.id%> <%=product.name%> </td> <td> <%=product.unit_price%> </td> <td> <%=product.quantity%> </td> <td> <%=text_field("product", "dem_quanti...
2006 Mar 10
3
css question
I''m doing this ''partial'' to do some ajax auto_complete <ul class="placements"> <% for client in @clients do -%> <li class="placements"> <div class="clwholename"><%=h client.clwholename %></div> <div class="id><span class="informal"><%= client.id
2006 Jun 07
1
Upload to DB hang mentioned in wiki
...byonrails.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 workaround: <%= hidden_field ''value'', ''1000000'' %> in the same form as my binary file_field. Substituting ''value'' for the same name as my binary field, and other random words didn''t help either. My intuition says that Rails will expect a specific name like max_i...
2006 Mar 15
5
acts_as_threaded - help ???
Hi, has anyone successfully used the acts_as_threaded plugin with postgresql? I''m using rails 1.0 and ruby 1.8.4 on linux. Following the screencast on http://www.railtie.net/articles/2006/02/05/rails-acts_as_threaded-plugin , I got to where we''re ready to create our first post, having made the changes to controllers/posts_controller.rb, views/posts/_form.rhtml,
2010 Apr 12
3
$(link).previous("input[type=hidden]") is undefined
...></td> </tr> <tr> <td class ="name"> commentaires sur la preparation : </ td><td></td><td><%= f.text_field :preparation %></td> <td></td> </tr> <%= f.hidden_field :_destroy %> <tr><td><%= link_to_function "remove", "remove_fields(this)" %></td></tr> </p> and in the appliction.js file I have: function remove_fields(link) { $(link).previous("input[type=hidden]").value = "1&...
2008 Apr 10
3
Custom Form Builder Help
...hool Type</div> <%= f.radio_button :type, "College", :label => "College/ University", :span => 4, :last => true %> <%= f.radio_button :type, "HighSchool", :label => "High School", :span => 4, :last => true %> <%= f.hidden_field :nid %> <%= f.submit "Create School" %> <% end -%> Anyone have an idea of what I''m missing here? Thanks, BJ Clark
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 :formatted_address, $FULL_ADDRESS %> <% end %> ... but with the twist that this form must be...
2006 Feb 07
3
Creating a new object with a passed in parent?
...#39;m confused by where Rails is going to make assumptions for me. Does article have a property called parent, or parent_id? When I set it do I just pass in an id and Rails knows what to do with it, or do I have to create the object myself and then set it? I tried something like this: <%= hidden_field ''article'', ''parent'', @parent %> where @parent had been defined in the new method as @parent = Article.find(params[:id]) but I got undefined method `stringify_keys'' for #<Article:0x2544068> I''m guessing that''s because I...
2006 Feb 15
6
error_messages_for trouble
...ash[:notice] = "Error creating folder" end redirect_to :action => "list", :id => params[:id] end end #### View ######################## <%= error_messages_for(:my_folder) %> <%= start_form_tag :action => ''create_folder'' %> <%= hidden_field "folder", "parent_id", :value => @current_folder.id %> <%= text_field "folder", "name", "size" => 20 %> <%= submit_tag "New Folder" %> <%= end_form_tag %> -- Posted via http://www.ruby-forum.com/.