Displaying 20 results from an estimated 11000 matches similar to: "error when updating table with select box"
2006 Jan 21
0
Select box problems
Hi all,
I am trying to get a select box to choose the type of goal records to
display using the scope field. I keep getting a " NoMethodError in
Admin#list" on line 8 "undefined method `scope'' for
{"scope"=>"Yearly"}:HashWithIndifferentAccess"
The code from list.rhtml is
<%= start_form_tag :action => ''list'' %>
2006 Apr 22
3
Creating a select dropdown box with links to methods
What would be the best way to create a form select dropdown box and upon
"submit" have it directly go to a controller method view?
I have something that somewhat works, but I think there is probably a
much easier way to do it. As of now, I have the dropdown list which
when the form is submitted is handed to a controller method which
basically
I have my dropdown box:
<%=
2006 Apr 26
7
Not updating
I copied the scaffolding edit and update and made it like this,
Note: awnser is edit.
Admin_contoller.rb
def awnser
@question = Question.find(params[:id])
end
def update
@question = Question.find(params[:id])
if @question.update_attributes(params[:question])
flash[:notice] = ''Question was successfully updated.''
redirect_to :action => ''list''
2005 Dec 17
0
Passing multiple parameters with select-option to controller
Hi all,
I''m using Windows Xp, Mysql 5, Webrick, Rails 1.0 I''ve 3 tables which
have HABTM relationship. My tables names are all set to uncountble. Name
of tabels are anabilimdali (includes department info id name etc.),
ogretimuye (personel information like id , name , dept. ) yayin
(document information), and for relationships yayin_anabilimdali ,
yayin_ogretimuye .
The
2005 May 17
2
Noob - ActionView::Helpers::FormOptionsHelper::select
Hi,
I''m just starting with Rails and i''m trying to do something like this:
<%= start_form_tag :action => ''add_user'', :id => @social_event_group %>
<%= select ''user'', ''id'' , User.find_all.collect {|u| [ u.login, u.id ]
}%></p>
<%= submit_tag "Add User" %>
<%= end_form_tag %>
2006 Jul 27
1
Weird issue with editing data.
Hi all.
Ive got a small CRUD app that is giving me some weird isuses.
If I add/create an entry that works fine, the data goes into the db. I
can later show the data, but when I edit it, no data is displayed in the
form for me to edit.
Here is the bits from the controller.
def new
@kb=Knowledgebase.new
end
def create
@kb= Knowledgebase.new(params[:kb])
if @kb.save
2006 Aug 09
2
how to access selected value in controller action
I have this in a view:
<%= start_form_tag :action => ''create_price'', :id => @media.id %>
<%= select("media", "price_code_id", PriceCode.find_all.collect {|pc|
[pc.name, pc.id ] }, { :include_blank => false }) %>
<%= submit_tag ''Add Price Code'' %>
<%= end_form_tag %>
My question is, how would I access the
2006 Jan 13
2
Change Password with acts_as_authenticated
I want to have a form to change a users password. I can''t figure out
what the method in the controller should look like. I tried @user.save
and @user.update_attributes, but can''t get it to work.
My Form:
##############################
<%= start_form_tag :action => "update_password", :id => @user.id %>
<%= password_field ("user",
2006 Jun 11
2
Finding a record and showing it -- how?
I''d like to prompt a user for the value of a Name field, then display
the record. Rails tells me that it cannot do a find without an ID. I
guess it must be that I''m not passing back properly the data from the
view to the controller.
Thanks for the help
joshi
The find_user.rhtml view:
<div class="find-name-form">
<fieldset>
<legend>Enter User
2006 Feb 19
0
looking for more idiomatic way of doing this
I have proposals and members can vote for them. In my proposal view I have a little div
where the currently logged in member can vote:
<div id="vote_div" class="vote">
Your vote:
<% if @member_vote %>
You have voted for this proposal<br />
<%= start_form_tag :action => "delete_vote" %>
<%= hidden_field_tag :id,
2006 Mar 17
2
Validation not working.......
HI,
I am new to ruby. I am developing small application in ROR. Following is
code for my rHtml , Controller & Model. PLease see it & let me know why
data in form is not get validated & also how to check for whether data i
have entered in form (username) is present in database or not? (Like
Login form).
following is my code:-
---index.rhtml--------
<%= start_form_tag(:action
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 Nov 11
1
Disable foms when submitting
Hey,
I want to disable the form when an user submits, I know that u can do
this with javascript. But i dont want to put code for each form on my
website, and I have a lot of forms like..
<%= start_form_tag :action => ''create'' %>
<table width="100%" border="0" cellpadding="0" cellspacing="5">
<tr>
<td
2006 Jun 20
2
Validation error_messages_for problem
I am having trouble getting error_messages_for to work.
My controller(relevant parts) looks like
def configure
@account = session[:account]
@user = User.new
end
def add_new_user_to_account
@user = User.new(params[:user])
if @user.valid?
session[:account].users << @user
end
redirect_to :action=> ''configure''
end
end
and my
2006 Feb 13
2
how to find the helpers code ?
Hello,
i have the application set up on my radrails. I was looking at the view
generated by scaffold and i see a bunch of names, after looking up
internet i found that they are helpers and generate the HTML for us.
Now, i wanted to look at the helper code for start_form_tag, so that
based on that i could write some of my own helpers in my helper
classes... but i could not find the code
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 29
1
validation in a "subform"
I''ve been following the rails/osx tutorial at
http://developer.apple.com/tools/rubyonrails.html
This develops a simple application with expenses and accounts.
Near the end of the tutorial, there is a view which allows expenses to
be added to an account.
This view has the "parent" @account rendered, then iterates throught
@account.expenses to display the existing accounts,
2006 Apr 10
0
Rails form error message oddness...
To get error messages for my form to show up I have to repeat myself in
the controller so that the render of the view including error messages
show up.
-------------------------
My Controller:
-------------------------
class ClientsController < ApplicationController
#---- index --------------------------------
def index
list
render :action => ''list''
end
2006 Jul 06
1
Problem implementing password and password confirmation
Hi,
I''m trying to implement password confirmation, based on the Agile
example, but just can''t make any progress.
User DB has these fields:
=========================
t.column :name, :string, :limit => 40
t.column :hashed_password, :string
t.column :salt, :string
User model has:
===============
attr_accessor :password_confirmation
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>