Displaying 20 results from an estimated 8000 matches similar to: "remote_form_for does not work with method = :get"
2009 Mar 10
5
onsubmit for remote_form_for not working properly
I want to use onsubmit for a form validation using javascript on
remote_form_for
for this i am doing something like this
<% remote_form_for :timesheet, @timesheet, :url =>{:action =>
''report_user''}, :html => {:onsubmit=>"return ValidateDate();" } do |f|
%>
// Form elements here
<% end %>
but it not works well. if condition return false
2008 Sep 07
1
remote_form_for, paths, and partials
hi,
i''m having a little trouble rendering a partial that uses a
remote_form_for and is in another controller.
<%= render :partial => "reviews/new"-%>
and in the partial i have only this, inside another controller
<% remote_form_for @review do |rv|-%>
<%= rv.hidden_field :value, :value => 1 -%>
<%= rv.image_submit_tag "thumbsupnc.png" %>
2007 Jul 12
1
remote_form_for behavior on javascript submit();
Hey all,
Tried this on the IRC channel but after an hour i figured nobody that
was on knew, so i''ll try it here. I have a rhtml page with:
<% remote_form_for(:performance_goal, :url =>
user_performance_goal_path(@user.account, @user,
@performance_goal), :html => {:id => ''sidebar_form'', :method => :put})
do |f| %>
<%= f.text_area :impact, :size
2008 Mar 07
6
creating a model registry
Hi all,
This is a problem I''ve approached so many times and always worked
around, that now I want to solve it once and for all. Say I have
something like this:
---
class X < ActiveRecord::Base
acts_as_wacky
end
module Wackinator
class ControlAllWackos
@@wackos = []
def self.kill_wackos
@@wackos.each(&:kill)
end
end
def acts_as_wacky
2008 Feb 23
3
Attachment_fu: how to remove images?
I just used attachment_fu for the first time, and it works quite well.
I have a user-model, and each of them has_one :image (and the images
belongs_to :user). I have a question on this though: how can i remove
images? Whenever i set a new image for a user (a user who already has
an image), then the table with images gets updated correctly, with the
user_id column of the old image set to null, and
2009 Mar 15
1
remote_form_for ajax validation
Hi,
I have been reading a lot about this, but I do not manage to do a nice
validation. I already managed to save data to the database, to
validate a field, to display a "Everything went well" message. I can
also display an error message, but the view does not end up properly.
This is the form:
<% remote_form_for(product) do |f| %>
<%= f.error_messages %>
<p>
2007 Aug 01
1
multipart remote_form_for
I''m trying to figure out how to create an AJAXified form with
remote_form_for that can submit a file upload, to no avail. Any pointers
for me?
- donald
--~--~---------~--~----~------------~-------~--~----~
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
2008 Feb 22
12
DRY - in controller or model????
Hello.
I''m trying to make clean efficient code and would like to find out if
there is a "BEST" way to write code. I want this to run quickly and
efficiently for my app.
I''ve got a form that needs a select list created for new and edit
functions. Same list.
Do I do this in the controller and reference @list in the forms?
def new
@list = %w { apple orange banana }
2009 Sep 24
5
Non-ActiveRecord based model being passed as string?
I have a model that looks like this (with various other methods)
class HsdPair
attr_accessor :hsd
def initialize(hsd)
@hsd = hsd
@current_display = 0
@has_changed_flag = false
end
end
After initializing this object in the controller
@hsd_pairs = HsdPair.new(@job.hsd_pairs)
using it in the view various times and in various ways, when I try to
pass this object back to the
2009 Aug 07
4
ActionController::UnknownAction (No action responded to 22.
I try to switch my application from Rails 2.2.2 to Rails 2.3.3.
In namespace :admin I have a resource-based controller. See controller
class Admin::OSystemsController < Admin::BaseController
def index
.......
end
def edit
.........
end
def update
..........
end
end
Resource is added to routes.rb like
map.namespace :admin do |admin|
............
admin.resources :o_systems,
2008 Feb 25
4
Using group in with find in an ActiveRecord appropriately
I''m playing around with the Practical Rails Projects code, and was
attempting to make a change for graphing data differently using
groupings.
Basically the code went from:
total_weight = @exercise.activities.collect {|e| e.repetitions
* e.resistance}
workout_dates = @exercise.activities.collect {|e|
e.workout.date.to_s}
To:
total_weight =
2009 Aug 06
18
Best Practices Question
Should models call action mailers, or should those calls always
originate from controllers? For example, should user.forgot_password
send the email, or should the user_controller.forgot_password?
Just looking for some opinions...
Thanks,
Tom
2009 Oct 28
2
What's the simplest way to use ActiveResource in ruby (without rails)?
I would like to use this class in a standalone project, but I have
been unsuccessful thus far.
Also, how does this class exactly communicate with the web server?
Thank you.
class Person < ActiveResource::Base
self.site = "http://localhost:3000/"
end
2008 Jan 03
0
remote_form_for with auto_complete_field
Hi friends
I have problem with auto_complete_field.
I have used auto_complete_field with in the remote_form_for.
But when we enter the text in auto_complete_field two actions are
calling
1. auto_complete_field action
2. remote_form_for action
I need to restrict the form action when we enter text on
auto_complete_field
Could u give any ideas?
<div
2008 Feb 29
7
Moving pagination to the Model
I''m using will_paginate in a Post class method;
[code]def self.list(page)
paginate :per_page => 10,
:page => page,
:include => :user
end[/code]
I can happily use the method on my posts controller index action;
[code]
class PostsController < ApplicationController
def index
@posts = Post.list(params[:page])
respond_to do |format|
2006 May 01
5
Adding classes without script\generate
Can I add classes to a rails application manually i.e without using
script generate Model/Controller?
The reason I am asking, I added a class by putting it in the controller
class. I can access the class and its method from command-line (irb),
but when I try to instantiate it in another controller, I get
"uninitialized constant" error.
If I try using script\generate Model
2008 Nov 20
1
My ignorance and Fuse (or glusterfs)
I have a very simple test setup of 2 servers each working as a glusterfs-server and glusterfs-client to the other in an afr capacity.
The gluster-c and gluster-s both start up with no errors and are handshaking properly..
One one server, I get the expected behaviour: I touch a file in the export dir and it magically appears in the others mount point. On the other server however, the file
2007 Jun 03
3
remote_form_for issue
Hi everybody,
I''m trying to change my current forms in my app to remote_forms. It was
my understanding that remote_form_for and form_for work in the same way,
so I just wanted to change the methods. My code looks like:
<% form_remote_for :post, :url => posts_url do |f| %>
<%= render :partial => ''form_posts'', :locals => {:f => f} %>
<%=
2009 Jan 18
2
InvalidAuthenticityToken error with remote_form_for
Hi All -
I have a form_for that I''m trying to convert to remote_form_for, and I
keep get this error:
ActionController::InvalidAuthenticityToken
(ActionController::InvalidAuthenticityToken):
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/request_forgery_protection.rb:86:in
`verify_authenticity_token''
2007 Jan 03
3
Self-referential habtm with condition is broken
Here''s a simplistic model class.
class Person < ActiveRecord::Base
has_and_belongs_to_many :relatives,
:class_name => ''Person'', :join_table => ''relatives'',
:foreign_key => ''from_id'', :association_foreign_key => ''to_id''
has_and_belongs_to_many :brothers,
:class_name =>