Displaying 20 results from an estimated 8000 matches similar to: "How do I pass query from from to the controller?"
2006 Jul 06
1
Form not inserting data into database
I have a form to register a user. The issue I am having is the fact that
it only populates login, hashed_password and created_at fields.
DB table:
create table users (
id int not null auto_increment,
login varchar(100) default null,
hashed_password char(40) default null,
email varchar(255) default null,
salt varchar(255) default
2006 Jul 21
1
Passing a variable between methods
Hi,
I am trying to add search functionality to may application. I am
struggeling to pass my query to the controller and then show all my
search results in another view. How would I do this?
Model:
class Advert < ActiveRecord::Base
belongs_to :user
def self.search(query)
if !query.to_s.strip.empty?
tokens = query.split.collect {|c| "%#{c.downcase}%"}
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
2007 Apr 20
1
Problem with form_tag
Hi all!
I''ve seen this problem in several places in the list, but none of the
remedies suggested seem to be helping me much.
I have a view like so:
HELLO
<% form_tag :action => "create" do %>
<p>My pretty form!</p>
<p><%= text_field "foo", "bar" %></p>
<p><%= submit_tag "Do
2006 Apr 05
8
Pass paramter via form
Hi,
I want to allow users ti search my blog. I have the following code
below to initiate the form.
<%= start_form_tag :action => ''search'', :search => search %>
<p align =center><%= text_field ''search'', ''search'',"size" =>"20" %>
<%= submit_tag ''Search'' %></p>
2006 Feb 07
3
Newbie help ..
Hi ..
I am new to Rails and it is not clear to me why I am getting the
following error. Any help appreciated.
-m.
$cat app/views/admin/new.rhtml
<% @page_title = "New member..." -%>
<%= start_form_tag( :action => ''create'' ) %>
<table>
<tr>
<td> First Name: </td>
<td> <%= text_field(
2006 Jan 28
0
Auto drop list: Create a form professional or easy?
Hi all,
I''m searching for a method to dynamically build a form. ( false/true field in
the DB should automatically be a droplist)
If you use "_form.rhtml" it works easy, with only this code in your partial,
but uses the extra file, and doesn''t feel profi and flexible.
<%= start_form_tag :action => ''create_product'' %>
<%= render
2006 May 18
2
attempt to override the ''tag'' method
I want to override the ''tag'' method in
ActionView::Helpers::TagHelper to do some generalized
error handling similar to the way scaffolding puts a
red border around fields that fail validation.
I''ve created a file lib/rails_patches/tag_helper.rb
which contains the following.
module ActionView
module Helpers
module TagHelper
alias_method :orig_tag, :tag
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 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 Jun 30
4
Serious noob question. Any help would be great
Hi All,
I''m working on building an app that can log and edit phone call
information. I''ve got the creating and editing parting working great,
and I''ve started an attempt to add searching. I can''t seem to figure
out how to get an [:id] parameter from a form and passed between two
controller methods. Right now I have a web page with a single text
field in it
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 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 Jul 08
2
Creating/Saving dependent objects
Folks,
Am new to RoR and am building an example to get myself familiar. I am
running into a simple issue while creating a user registration page.
I have a User and Address models defined as below (partial/relevant code
included below). User has_one address and Address belongs_to user. I have a
foreign key defined in address table that refers to user(id)
In a form I take in username, password,
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 Aug 14
2
(no subject)
I have the following code that generates a rhtml page,
<%= start_form_tag :action => ''create'' %>
<%= render :partial => ''form'' %>
<%= submit_tag "Create" %>
<%= end_form_tag %>
<%= link_to ''Back'', :action => ''list'' %>
...I am trying to put a "Browse" button to
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 Feb 21
0
best practices for simple query
I have a very simple form that looks allows an input for an error code
and then give the show page from the scaffolding if the error code is
in the database and a notification on the list page, again from the
scaffolding if not.
Here''s the form:
find.rhtml
<h1>Find error</h1>
<%= start_form_tag :action => ''search''%>
<p><label