You can't have multiple objects for a form_for, it can only be one.
If you want to do a subobject, a fields-for is available.
On Tuesday, April 4, 2017 at 7:00:20 PM UTC-4, fugee ohu wrote:
>
> <%= form_for[@user, @address], :url => users_addresses_set_current_path(
> current_user.id, a.id) do
Sorry I put the wrong line of HTML, the form works:
Here it is in Chrome
What is interesting is that in Firefox the tag shows up and works fine:
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" g
This is a broader issue than just file uploads anyway so I need to learn
this, if you read the link I posted they make carrierwave sound good so i
wanna get comfortable with using it
On Friday, January 22, 2016 at 9:20:04 PM UTC-5, Przemek Kosakowski wrote:
>
> Are you using Paperclip or other
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote:
>
> This form raises undefined method `pictures_path' for
> #<#:0xbb9cb4c>
>
> <%= form_for(@picture, :html => { :multipart => true }) do |f| %>
>
>
> <%= f.file_field :image %>
>
>
> <%= f.submit %>
>
> <% end %>
>
>
I'm using carrierwave In my controller I can test for the presence of
params[profile_id] and then i would know the value of imageable_type should
be set to profile but how do i pass a value for imageable_id ?
On Friday, January 22, 2016 at 9:20:04 PM UTC-5, Przemek Kosakowski wrote:
>
> Are you
Are you using Paperclip or other gem ? I'm asking because Paperclip
resolved this issue and you don't have think about this other fields and
values.
W dniu 23.01.2016 o 03:17, fugee ohu pisze:
How do i get the values for imageable_id and imageable_type inserted
into a new picture object? i ca
How do i get the values for imageable_id and imageable_type inserted into a
new picture object? i can put imageable_type as a hidden field, but
imageable_id i don't know
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote:
>
> This form raises undefined method `pictures_path' for
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote:
>
> This form raises undefined method `pictures_path' for
> #<#:0xbb9cb4c>
>
> <%= form_for(@picture, :html => { :multipart => true }) do |f| %>
>
>
> <%= f.file_field :image %>
>
>
> <%= f.submit %>
>
> <% end %>
>
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote:
>
> This form raises undefined method `pictures_path' for
> #<#:0xbb9cb4c>
>
> <%= form_for(@picture, :html => { :multipart => true }) do |f| %>
>
>
> <%= f.file_field :image %>
>
>
> <%= f.submit %>
>
> <% end %>
>
>
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote:
>
> This form raises undefined method `pictures_path' for
> #<#:0xbb9cb4c>
>
> <%= form_for(@picture, :html => { :multipart => true }) do |f| %>
>
>
> <%= f.file_field :image %>
>
>
> <%= f.submit %>
>
> <% end %>
>
>
On Friday, January 22, 2016 at 6:11:34 AM UTC-5, Przemek Kosakowski wrote:
>
> Many pictures for user profile ? I can't agree but okay. If you have many
> pictures for one user then you should create Gallery model instead of
> Picture. Even on fb user be able to have only one profile picture.
>
Many pictures for user profile ? I can't agree but okay. If you have
many pictures for one user then you should create Gallery model instead
of Picture. Even on fb user be able to have only one profile picture.
But I don't judge, maybe your solution is effective.
W dniu 22.01.2016 o 12:06, fu
On Friday, January 22, 2016 at 6:01:33 AM UTC-5, Przemek Kosakowski wrote:
>
> many pictures you mean "a few different user profile photo" or you mean
> "few copy of the same picture but different size/dimension" ?
>
> W dniu 22.01.2016 o 11:59, fugee ohu pisze:
>
> On Thursday, January 21, 2016 a
many pictures you mean "a few different user profile photo" or you mean
"few copy of the same picture but different size/dimension" ?
W dniu 22.01.2016 o 11:59, fugee ohu pisze:
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote:
This form raises |undefined method `picture
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote:
>
> This form raises undefined method `pictures_path' for
> #<#:0xbb9cb4c>
>
> <%= form_for(@picture, :html => { :multipart => true }) do |f| %>
>
>
> <%= f.file_field :image %>
>
>
> <%= f.submit %>
>
> <% end %>
>
>
actually it prepends in singular listing_title, listing_description, etc
On Thursday, December 3, 2015 at 2:04:19 AM UTC-5, fugee ohu wrote:
>
> Why does <%= form_for(@listing) do |f| %> the form helpers f.select,
> f.label, f.text_field, f.checkbox, f.radio_button all prepend model names
> to
Hey Dave,
Before any controller action use "raise params.inspect ", you will get
parameters coming from Form. You have to use that parameters only .
In your case just add this line in edit action (Edit Method) "raise
params.inspect". you will get all parameters.
On Mon, Nov 3, 2014 at 7:19 PM,
Matt Jones wrote in post #1161637:
> On Sunday, 2 November 2014 20:57:43 UTC-5, Ruby-Forum.com User wrote:
>> ...
>> <%= f.submit 'Update', :class => 'btn btn-primary' %>
>> ...
>> <% end %>
>>
>> @profile contains # as it should.
>>
>> routes contains: resources :profiles and
On Sunday, 2 November 2014 20:57:43 UTC-5, Ruby-Forum.com User wrote:
>
> Hi,
> When I try to update a field using the update button I am getting the
> error: No route matches [PATCH] "/profile". Its obviously missing the
> /:id but I can't figure out why...
>
> I am using a form_for in an e
sampath n. wrote in post #1161624:
> Form_for will get the :id by default. which version are you using and
> please paste the controller code here. tks
>
> On Mon, Nov 3, 2014 at 10:16 AM, BalaRaju Vankala
>
Rails 4.0.3
Controller code:
def edit
@banner_title = "Edit Profile"
@profile =
Fred,
Thanks for the interest:
[#,
#,
//Cris
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rubyonrails
On Tuesday, February 11, 2014 4:46:41 PM UTC, Ruby-Forum.com User wrote:
> My team is currently upgrading a rails app from 3.2.3 to 4.0 with JRuby
> 1.7.10 backed by Oracle. Under Rails 3.2.3 everything is nice and
> happy...
>
> We have a model called JobMetadata and every numeric column is
so if in your action you do
@relationship = current_user.relationships.build(followed_id: @user.id)
you should have a variable called relationship on your view:
<%= form_for(relationship) do |f| %>
<%= f.hidden_field :followed_id %>
<%= f.submit "Follow", class: "btn btn-large btn-primary"
I'm having this same problem. did you ever get this resolved?
On Wednesday, April 18, 2012 1:23:07 PM UTC-4, Everton Cardoso wrote:
>
> Hi guys, I have a problem with form_for helper method.
>
>
> Scenario:
>
> My models
>
>
>
> Org::Organization and Org::Member
>
>
> routes.rb
>
This was really useful. Thanks for leaving info on how you did it.
On Wednesday, May 13, 2009 1:43:10 AM UTC-5, Jacob Patton wrote:
>
> I'm using Rails to create a schedule of a shop's opening and closing
> hours. Simplified versions of the models I've set up is:
>
> class Account < ActiveRecor
Issue resolved:
http://stackoverflow.com/questions/11713427/form-for-with-module-and-namespace
--
Posted via http://www.ruby-forum.com/.
--
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-t
With the resources :bill_recs, :path => '/finance' ... and scope
"/finance" do ... it appears a message:
ActionController::RoutingError (uninitialized constant
BillRecOffController):
I need to put the models into a namespace beacause there are many files
in my
project, then Finance::BillRec
rake routes:
finance_bill_rec_bill_rec_offs GET
/finance/bill_recs/:bill_rec_id/bill_rec_offs(.:format)
finance/bill_rec_offs#index
POST
/finance/bill_recs/:bill_rec_id/bill_rec_offs(.:format)
finance/bill_rec_offs#create
new_finance_bill_rec_bill_rec_off GE
And hopefully something simpler than looping through all the fields and
manually setting their default values:
http://stackoverflow.com/questions/8767048/how-can-i-update-a-default-value-for-a-form-field-after-an-ajax-submission-not
--
You received this message because you are subscribed to the
Thanks a lot for your help.
This little "=" was missing and I was not able to see it.
Best regards.
Colin Law wrote in post #1060124:
> On 9 May 2012 11:08, Paulo Carvalho wrote:
>> [code]
>> view_by :id,
>> [quote]
>> end
>> <% form_for @author do |f| %>
> Try <%= form_for ...
>
> If that sti
And also I had detected that if I change
def escape_once(html)
ActiveSupport::Multibyte.clean(html.to_s).gsub(/[\"><]|&(?!([a-zA-Z\u00C0-\u00FF]+|(#\d+));)/)
{ |special| ERB::Util::HTML_ESCAPE[special] }
end
method in
c:\Ruby187\lib\ruby\gems\1.8\gems\actionpack-2.3.5\lib\
Frederick Cheung wrote in post #1029736:
>
> I'd start by checking that you are using the same encoding throughout
> the app (the encoding advertised to the browser, database connection
> encoding, encoding of the table/columns etc) or funny things will
> happen. For example if you try and insert i
It seems like you already have a member.
Post works for create. you should be using Put.. because it seems like
an update.
Ajit
On Jun 30, 10:34 am, Erwin wrote:
> I defined a renew route for membership resources as following :
>
> scope 'users' do
>
> resources :membership
I've read what you posted and I'm still not sure what you are trying to
do here. Start out by providing the following and use
(http://gist.github.com) for posting the code for readability.
Model Files: post your user.rb and profile.rb
Schema: post your schema for user and profile
Controller Fil
When you do f.check_box(:i) Rails expects the model for the form instance
(in this case, User) to have an attribute called "i".
You can use the "check_box_tag" helper to generate a check box that is not
tied to a model.
--
You received this message because you are subscribed to the Google Grou
DC,
Try this,
http://www.railsforum.com/viewtopic.php?id=717
Use form_tag instead form_for
Saravanan K
http://bit.ly/9NpP7e
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this gro
On 7 May 2011, at 02:04, S Ahmed wrote:
> Thanks.
>
> When you add something to a helper like articles_helper, does it have the
> request object in there also?
>
> How does it get the @articles object when I call it like:
>
Controller instance variables are copied across to the view objec
Thanks.
When you add something to a helper like articles_helper, does it have the
request object in there also?
How does it get the @articles object when I call it like:
form_for @article, correct_post_path, ...
I would have though it would be:
form_for @article, correct_post_path(@article), .
You can create a helper method (in helpers/articles_helper.rb):
def correct_post_path
@article.persisted? comment_article_path : articles_path
end
And then use this helper in your form builder
form_for @article, correct_post_path do ... end
That helps ? Maybe you can tell us under what co
It can certainly be done easy enough, but I'd question the problem you are
trying to solve if you want to do something like that.
--
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@googl
solution found. there is apparently a conflict with an older version
of haml.
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5493
install haml 3.0.18 or higher to resolve.
On Nov 3, 7:54 pm, "tashfeen.ekram" wrote:
> Any ideas? Below is the dev log when i load that page. no
even when i add random text with the form liek "Email" as below is not
even outputted. it is as if the whole blcok is being ignored...
<%= form_for @user_session, :url => user_session_path do |f| %>
Email
<%= text_field_tag :login %>
Password
<%= f.password_field :password %>
Rem
Any ideas? Below is the dev log when i load that page. none of the
below seems to be related.
Started GET "/login" for 127.0.0.1 at Wed Nov 03 19:53:35 -0400 2010
DEPRECATION WARNING: Base.named_scope has been deprecated, please use
Base.scope instead. (called from /var/www/drugbin/app/models/user
Creative Technologist wrote in post #958582:
> Hi,
>
> Could anyone tell me what I'm doing wrong below when trying to apply a
> style to the following label and text field
>
>
> <%= f.label :name, :html => {:class => "label"} %>
> <%= f.text_field :name, :html => {:class => "label"}
hmmm... well i installed that plugin however i am still having no
luck.
form_tag seems to work properly.
my dev log does not give me any errors, just some depreciation warning
unrelated to this problem.
any ideas?
On Oct 27, 11:30 am, Ganesh Kathare wrote:
> tashfeen.ekram wrote in post #95737
tashfeen.ekram wrote in post #957373:
> I am upgrading to rails 3 and afer diong so, none of my form_for are
> working. (I can not actually say not all of them are working but the
> few that i have tried are not). The page loads fine but the form is
> not output. This is after making the the change
> <%= form_for @user_session, :url => user_session_path do |f| %>
> Email
> <%= text_field_tag :login %>
> Password
> <%= f.password_field :password %>
> Remember Me
> <%= f.check_box :remember_me %>
> <%= f.submit "Login" %>
> <% end %>
replace <%= text_field_tag :login %> with
This is a method generated for you by rails as a result of the
associtions declared in the Post and Comment models - in this case
belongs_to and has_many. Comments belongs to a post, and a post can
have many comments.
Rails creates quite a number of theses methods in response to the
association,
Rick,
Seems this is broken also at your LinkedIn:
http://speakerrate.com/speaker/395-rdenatale
This is beside "Websites".
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group,
Rick,
Just a small note under "links" at your blog, it seems tht the
"Redhanded" is broken.
--
Posted via http://www.ruby-forum.com/.
--
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-t...
Thanks s lot Rick for this nice explnation. Yes, does make sense.
--
Posted via http://www.ruby-forum.com/.
--
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-t...@googlegroups.com.
To unsubs
On 14 August 2010 15:34, Abder-Rahman Ali wrote:
> Frederick Cheung wrote:
>> On Aug 14, 2:23�pm, Abder-Rahman Ali wrote:
>>> form_for: used to generate a form.
>>> @post: the object form_for is bound to.
>>>
>>> The part I didn't get here is:
>>>
>>> @post.comments.build
>>>
>>> What does that p
Frederick Cheung wrote:
> On Aug 14, 2:23�pm, Abder-Rahman Ali wrote:
>> form_for: used to generate a form.
>> @post: the object form_for is bound to.
>>
>> The part I didn't get here is:
>>
>> @post.comments.build
>>
>> What does that part provide me with?
>
> It's a namespaced resource - it's a
On Aug 14, 2:23 pm, Abder-Rahman Ali wrote:
> At the following:http://edgeguides.rubyonrails.org/getting_started.html
>
> Under: 7.4 Generating a Controller
>
> It mentions the following:
>
> <%= form_for([...@post, @post.comments.build]) do |f| %>
>
> Now, this is what I know:
>
> form_for: use
Thanks, Bill. I checked out the documentation on REST and it makes
much better sense now.
On Jun 28, 10:15 am, bill walton wrote:
> Hi Richard,
>
> On Mon, 2010-06-28 at 06:46 -0700, richardsugg wrote:
> > I'm really baffled since this should be very textbook:
>
> > <% form_for :person, :url =>
That would do it.
Meanwhile, if you are using form_for, you should do this:
<%= f.text_field :first_name %>
The f knows it refers to the person record because you told it so with
form_for...
On May 14, 9:50 am, Joshua Martin wrote:
> I feel quite stupid now.. Apparently, I had some JQuery for a
Still stuck with this problem.
Does no one have any pointers on this?
--
Posted via http://www.ruby-forum.com/.
--
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-t...@googlegroups.com.
To u
On 6 March 2010 18:50, Ralph Shnelvar wrote:
> Consider the following:
>
> - - -
> <% form_for @countryToSearchFor, :url => signed_in_path(:action =>
> "show",
> :id => 'connected_to_country', :something => 'other'),
> :html => {:method => :get} do |f| %>
>
> <%= f.select :country,
Consider the following:
- - -
<% form_for @countryToSearchFor, :url => signed_in_path(:action =>
"show",
:id => 'connected_to_country', :something => 'other'),
:html => {:method => :get} do |f| %>
<%= f.select :country, language_neutral_array_of_countries,
:prompt => 'e
Ralph Shnelvar wrote:
> <% form_for @countryToSearchFor, :url => { :action => "show", :id =>
> "connected_to_country" }, :html => {:method => :get} do |f| %>
I hit the dame return key. Ugh.
Anyway ...
Is this the place I should modify so that when the user hits the submit
button associate
This also works, and seems a lot more elegant:
<% form_for [...@course, @discussion, Message.new] do |f| %>
On Feb 16, 2:59 am, Seirie wrote:
> Ahh, got the first issue as well. For anyone that's interested, I was
> able to get my desired result with:
>
> <% form_for Comment.new, :url =>
> categ
Ahh, got the first issue as well. For anyone that's interested, I was
able to get my desired result with:
<% form_for Comment.new, :url =>
category_post_comments_path(:category_id => @category, :post_id =>
@post) do |f| %>
On Feb 16, 2:41 am, Seirie wrote:
> Alright, I figured out the second iss
Alright, I figured out the second issue there, I needed to pass in a
reference to the course in question: <%= link_to
book_pages_path(@book) %>
Man I'm losing it, time for bed, lol.
On Feb 16, 2:24 am, Seirie wrote:
> Hmmm, maybe I'm thinking about this all wrong. It seems like its grown
> into
Hmmm, maybe I'm thinking about this all wrong. It seems like its grown
into an even bigger issue now.
If I try to access a nested route from it's parent resource, I cant.
I'll give you an example:
If I try to use <%= link_to book_pages_path %> from a page with the
URL of "books/1", I get an error
thanks .. got it.. see my answer to Colinthe doc info is not
obvious... I had to read between lines and test test test ...many
different options to watch the generated htmlbut it works
well now... ( I keep the 'recipe' in my NoteTaker ;-)))
On 10 oct, 20:18, Cris Shupp wrote:
Thanks Colin... I looked into it in parallel ... not obvious but I
found the solution (many tries.. as it's not the 'standard' way.. but
I'm just writing a quick app draft)
<% form_for :tutor, @tutor, :url => { :action => "create" }
for new/create records
<% form_for :tutor, @tutor, :url
Erwin,
If I understand what you are trying to do then I was trying to solve a
similar but lesser problem. How to send form data from one method in a
controller to another method in the same controller Iit does seem to
work for your case though). Here is a sample erb:
gather.html.erb
Gatheri
2009/10/10 Erwin :
>
> @trainee is an instance of User class
>
> my form partial code :
>
> <% form_for :@trainee, :html => {:class => 'generalform'} do |form| %>
> <%= render :partial => "form", :object => form %>
> <%= form.submit "Register", :class => 'go' %> <%= link_to
> 'Cance
To anyone who is experiencing this problem, there's a patch to rectify
this already.
https://rails.lighthouseapp.com/projects/8994/tickets/3144-undefined-method-for-string-ror-234
The latest master branch at github should fix this too! Phew...
On Oct 7, 2:42 am, Colin Law wrote:
> 2009/10/6 Br
2009/10/6 Bryan L :
>
> On Oct 6, 11:19 pm, Colin Law wrote:
>> I think a lot of people have had this problem, I believe it is a known
>> bug in Rails 2.3.4. I understand the easiest solution is to go down
>> to 2.3.3 if possible.
>> Colin
>>
>
> What about generating normal forms? I can't seem
On Oct 6, 11:19 pm, Colin Law wrote:
> I think a lot of people have had this problem, I believe it is a known
> bug in Rails 2.3.4. I understand the easiest solution is to go down
> to 2.3.3 if possible.
> Colin
>
What about generating normal forms? I can't seem to do it without
errors.
<% for
2009/10/6 Bryan L :
>
> Thanks Coiln. I deleted that message actually because it slipped my
> mind that the line which I defined @design as a Design model got
> deleted off when I regenerated the controllers and models. I fixed
> that already so now I'm stuck with another different undefined metho
Thanks Coiln. I deleted that message actually because it slipped my
mind that the line which I defined @design as a Design model got
deleted off when I regenerated the controllers and models. I fixed
that already so now I'm stuck with another different undefined method
error:
undefined method `^'
2009/10/6 Bryan L :
>
> My bad.. I regenerated the controllers and models and the previous
> error seemed to be gone but now I'm getting this error instead:
>
> Called id for nil, which would mistakenly be 4 -- if you really wanted
> the id of nil, use object_id
>
> If I understand correctly, this
My bad.. I regenerated the controllers and models and the previous
error seemed to be gone but now I'm getting this error instead:
Called id for nil, which would mistakenly be 4 -- if you really wanted
the id of nil, use object_id
If I understand correctly, this statement "<% form_for([:admin,
@
Thanks Sijo for the help. I've made the changes according to your
suggestions. The error message is now different, but I guess there's
some improvement!
"undefined method `^' for "f":String"
My routes.db:
map.namespace(:admin) do |admin|
admin.resources :designs
end
Any idea
Hi Bryan L wrote:
> This is what I have in my routes.rb:
> map.with_options(:namespace => "admin") do |admin|
> admin.resources :designs
> end
You have to modify your routes as
map.namespace(:admin) do |admin|
admin.resources :designs
end
And also generate controller and model li
If you want to go to a different page from the update action just add
a redirect_to list_translations_url or something like that after the
flash[:notice]
Your route.rb looks correct
On Sep 4, 8:21 am, manaus wrote:
> maybe I found the cause, routes.rb has
> map.resources :houses
--~--~-
maybe I found the cause, routes.rb has
map.resources :houses
--~--~-~--~~~---~--~~
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@googlegroups.com
To uns
Ar Chron wrote:
> Where the user goes after a create or update is the controller's
> decision...
Here is the controller action...
def update
@house = House.find(params[:id])
if @house.update_attributes(params[:house])
flash[:notice] = "Traduzione salvata"
end
end
Where the user goes after a create or update is the controller's
decision...
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this gr
On Wed, Aug 12, 2009 at 9:59 AM, bill walton wrote:
> I haven't used Chrome but it's
> difficult to believe that there aren't tools equivalent to Firebug, Live
> Http Headers, etc. to assist developers targeting that platform. If
> there aren't
The nightly PPA Chrome builds do provide some fairl
On Wed, 2009-08-12 at 07:00 +0200, Rails List wrote:
> I guess, we have to assume that the http verb being used by chrome
> appear to be 'GET' rather than 'POST'.
You shouldn't have to assume anything. I haven't used Chrome but it's
difficult to believe that there aren't tools equivalent to F
Wap Addon, thanks for your suggestions. But they are not working. Are
they working for you?. Did you try it in Chrome for this or any of your
rails app?
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are
<% form_for :classified, :url=>{
:controller=>'classifieds', :action=>'create'}, :html => { :multipart =>
true } do |f| %>
<%= error_messages_for 'classified' %>
<%= submit_tag 'Post' %>
<% end %>
write like this no for <% form_for(@classified, :html => { :multipart =>
true }) do |f| %> this
Wap Addon wrote:
>
> <% form_for :classified, @classified, :url=>{
> in this not both required remove @classified and try to run it
No change even after trying with
<% form_for(@classified, :html => { :multipart => true }) do |f| %>
--
Posted via http://www.ruby-forum.com/.
--~--~-~--
<% form_for :classified, @classified, :url=>{
in this not both required remove @classified and try to run it
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails:
I tried this again with scaffold. When the validation is triggered,
Chrome executes index action at the background (right click your browser
and view source).
I guess, we have to assume that the http verb being used by chrome
appear to be 'GET' rather than 'POST'.
Has anyone encountered simil
And please post the form_for code.
Thank you.
On Wed, Aug 5, 2009 at 3:33 AM, Conrad Taylor wrote:
> On Tue, Aug 4, 2009 at 9:34 PM, Md Fisa
> wrote:
>>
>> Nicholas Henry wrote:
>> > You need to move the :onclick => "ValidateForm()" to :onsubmit =>
>> > "ValidateForm()" in the form_for line. Th
On Tue, Aug 4, 2009 at 9:34 PM, Md Fisa wrote:
>
> Nicholas Henry wrote:
> > You need to move the :onclick => "ValidateForm()" to :onsubmit =>
> > "ValidateForm()" in the form_for line. Then when the ValidateForm
> > returns false it will halt submission of the form.
> >
> > You might want to cons
Nicholas Henry wrote:
> You need to move the :onclick => "ValidateForm()" to :onsubmit =>
> "ValidateForm()" in the form_for line. Then when the ValidateForm
> returns false it will halt submission of the form.
>
> You might want to consider using something like this:
> http://www.livevalidation.
On Tue, Aug 4, 2009 at 7:16 AM, Conrad Taylor wrote:
> On Tue, Aug 4, 2009 at 4:38 AM, Md Fisa > wrote:
>
>>
>> hi everybody...
>>I have a form_for in that, onclicking submit button i am calling
>> a javascript for validation.If validation fails that form_for doesnt do
>> anything.But e
On Tue, Aug 4, 2009 at 4:38 AM, Md Fisa
wrote:
>
> hi everybody...
>I have a form_for in that, onclicking submit button i am calling
> a javascript for validation.If validation fails that form_for doesnt do
> anything.But even the validation fails it goes to the controller and
> action.
>
You need to move the :onclick => "ValidateForm()" to :onsubmit =>
"ValidateForm()" in the form_for line. Then when the ValidateForm
returns false it will halt submission of the form.
You might want to consider using something like this:
http://www.livevalidation.com/
There's a Rails plugin as we
I figured it out. It was directly related to the form_for syntax. I
guess that when rails generates the alternative explicit index route.
In this case "admin_news_index" vs "admin_news" a more explicit syntax
is needed.
Instead of this:
<% form_for [:admin, @news] do |f| %>
I found this solved
Thanks for the input guys.
The "adminl" is a email typo only...
Here's a truncated version of my route config.
map.namespace :admin do | admin |
admin.resources :news, :collection => {:sort => :post}
end
My tests confirm that news_controller.rb#new is indeed sending out a
new @news objec
Hi --
On Mon, 20 Jul 2009, s.ross wrote:
>
> You might consider adding an inflection for news in your config/
> initializers/inflections.rb. That will tell Rails that the plural of
> news is news. There are examples in the Rails-generated file.
It's already there. I don't think this is actually
Hi --
On Mon, 20 Jul 2009, elliottg wrote:
>
> I have been using this namespaced form_for syntax with no problems:
> <% form_for [:admin, @products] do |f| %>
>
> However, now that I am working with a model and controller called
> "news" which has no differentiation between singular and plural.
You might consider adding an inflection for news in your config/
initializers/inflections.rb. That will tell Rails that the plural of
news is news. There are examples in the Rails-generated file.
On Jul 20, 2009, at 12:00 PM, elliottg wrote:
>
> I have been using this namespaced form_for syn
2009/7/1 Bryan Ash :
>
> I fully suspect that I'm missing the point here somewhere so I promise
> I won't be offended if you tell me I'm being daft.
>
> My application rents equipment ... not equipments. So I have the
> following:
>
> map.resources :equipment, :singular => :equipment_instance
>
1 - 100 of 132 matches
Mail list logo