Hey I am making a photo website for a class and I am stuck i need to
have a text_area pick up a variable and put it in my controller to
change the number of thumbnails that show up on my view page. I can not
figure out how to create this and make a text_area and button to submit
it and have the page refresh with the new number of thumbnails on it.
Here are some snippits of my code.
photos_controller.rb
def list
@photo_pages, @photos = paginate :photos, :per_page =>
((@params[:pagesize]) || 12)
end
def update_list
@pagesize = pagesize.new(params[:pagesize])
@pagesize.save
@pagesize = pagesize.find(params[:pagesize])
#auto_complete_for :pagesize
@photo_pages, @photos = paginate :photos, :per_page =>
pagesize.find(params[:pagesize])
end
---------------------------------------------------------------
list.rhtml
<p>
<%= form_tag({:action=>''create''}, :multipart =>
true)%>
<p><label for="photo_title">Title</label><br/>
<%= text_area ''pagesize'', ''size''
%></p>
<%= submit_tag "Submit" %>
<%= end_form_tag %>
<% #render :action => ''pagesize'' == @params[:pagesize]
%>
</p>
--
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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---