Displaying 20 results from an estimated 30000 matches similar to: "Submitting form using link_to"
2006 Jul 25
6
form and pagination question
Hello,
How do I get params from a form to use with a paginator?
debug(params) shows this
city: !map:HashWithIndifferentAccess
id: "1"
but in my controller, when I try to use
@hotel_pages = Paginator.new self, Hotel.count(:conditions =>
"hotels.city_id = params[:city][:id]"), 3, @params[''page'']
it doesn''t work. I suppose it''s a simple
2006 Jun 07
2
Hash flattening on paginator link_to
Hey
I need some help with pagination and the link_to in the view.
I''m trying to include a hash in the pagination link_to params and it
keeps flattening out my hash.
Example:
Here''s my hash called @answer:
"answer"=>{"6"=>"9bf31c7ff062936a96d3c8bd1f8f2ff3",
"7"=>"6f4922f45568161a8cdf4ad2299f6d23"}
2008 Oct 31
6
link_to submit form value 2
Hi to all,
I''d like to pass with a link to values inside some form. I''ve read in
other posts that it''s possible if i include the forms inside a html
<div>...
So here it''s my code of the view :
<div id="study">
<table>
<tr><td><label for="study_titolo">Titolo di
2006 Mar 31
4
Question about pagination
Hi!
I''ve got a list of project on the main page and if one of them is
selected i render a partial using ajax with data of selected project.
How to create links to next/previous project using pagination?
--
Posted via http://www.ruby-forum.com/.
2005 Dec 19
6
custom find methods and pagination
i''ve got several methods in my models i use to find based on certain
criteria...i''ve done this so the controller code is less cluttered, plus the
DRY factor.
example:
class Foo < ActiveRecord::Base
def find_by_something(something)
find :all, :joins => ..., :conditions => ...
end
def find_by_something_else(something_else)
find :all, :joins => ...,
2006 Apr 16
11
Best way to sort categories w/ pager
Ahoy,
I made this pager,
" def list
@item_pages = Paginator.new self, Item.count, 10, @params[''page'']
@items = Item.find :all, :conditions => "category_id =
#{params[:condition]}",
:limit => @item_pages.items_per_page,
:offset => @item_pages.current.offset
@categories = Category.find_all
2005 Jun 10
1
Submitting an ajax form via a select
I''m trying to submit an ajax form via an onchange method in a select
menu, but I can''t seem to do it.
The problem holding me up, is that I can''t figure out how to set the
ID of the form when using a form_remote_tag (I need to use the ID of
the form as the forms on the page are variable, so I can''t reference
it in the form array). Setting :id =>
2007 Nov 05
3
link_to & others really necessary?
One of the areas where I think Rails goes too far is in many of the
helpers that (AFAICT) do nothing more than change the syntax used to
write simple HTML tags. link_to and many of the form tags come to mind.
For me, these helpers aren''t that helpful. I find the HTML much
clearer to write and read, I don''t see any added value in the
overhead costs of using code to
2006 Jan 31
6
Pagination - why is it this hard?
Hi everyone,
I''m at the end of my rope on this. I can''t get pagination to work
with anything but a standard find on a model. If I try to do a search
and customize the pagination, I get lots of different variations.
My thought was to have the list action do what it does, but to pass it
a list of search conditions from the search action. So, if search
determines that we need
2006 Jan 22
6
Destructive behavior with link_to, button_to, :post=>true
Hello-
I would like to know what the suggested practice is for having multiple
submit buttons on a relatively complicated input page.
Let''s use the example of a Contact. There is lots of info there,
including name, address, phone number. There is also a list of "contact
associations" which can be modified on the same page.
Ideally, the user could have one
2006 Jul 16
3
pagination over custom-sorted collections?
I have a little web app where we need to paginate collections of
items. I''m trying to sort the collection and then pass it, sorted, to
a Paginator, and still be able to paginate through the collection,
across several pages, with the new sort order. The only thing I''m
doing differently from the regular scaffolding approach is this:
@order_pages = Paginator.new(self,
2005 Jul 17
0
RE: link_to and CSS
What you want is a.linkCommand:hover, etc
-----Original Message-----
From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Shelby Westman
Sent: Monday, 18 July 2005 2:20 AM
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: [Rails] link_to and CSS
I am a bit confused about how
2007 Jan 22
0
How to stop return key from submitting form
I''ve got an ajaxed form going that is set up to have the user type
something in a text field and hit a button that throws that entry into a
table on the page. User is expected to enter several items, and then
submit the form which goes to the next page.
I would like the user to be able to enter an item and hit the return key
to toss it into the table, but either Rails or the browser
2006 Apr 05
0
Submitting sortable_element as part of form
Good evening all...
I''ve been marveling over how easy it is to make amazing drag-sort
interfaces using sortable_element. My users are really blown away by
how intuitive and simple these controls are. However, in my current
project I''m trying to use it in a particular way which has me stumped.
Normally the sortable_element makes an AJAX request whenever it is
changed.
2006 Jan 03
1
Passing parameters with link_to
I have following code in my controller:
class AlbumsController < ApplicationController
def list_by_year(year)
@album_pages
@albums = paginate :albums,
{ :per_page => 10,
:conditions => ["year = ?", year] }
render :action => ''list''
end
end
Now I want to make a link to the list_by_year action in
2006 Jul 01
1
Paginator offset =0 ...
Hi list,
I Try to do a custom paginator, but the offset never increase ??
def
showFriends
@friends_pages = Paginator.new self, allFriends.size, 3,
@params[''page'']
limit= @friends_pages.items_per_page
offset= @friends_pages.current.offset
2005 Dec 16
13
How to pass a collection to paginate?
There must be a better way to write this code:
@project_pages, @projects= paginate :project,
:per_page => 10,
:conditions => ["account_id = ?", account]
?!
If only I could pass the sub-collection
account = ...
@projects = account.project
to paginate, instead of letting it extract it with a find :all + sql
conditions
Alain.
--
Posted via
2006 Apr 26
2
Problem with auto-submitting AJAX form
Hello,
I have a form generated with form_remote_tag that contains a selection
list. I would like to auto-submit the form when the user makes a choice
in the selection list, so I added an option :onchange =>
''this.form.submit()'' to select_tag
Now what happens is that when I make a choice, the partial template
get''s rendered as expected, but not replacing the
2006 Apr 18
1
Pagination links with separator
Hi,
I have @result_pages and @results obtained from paginate in an action. I
want to show the pages as
1 | 2 | 3 | 4 >
The fifth page will show:
< 5 | 6 | 7 | 8 >
and so on.
How exactly do I render the paginator to give this effect? I guess I
will have to use pagination_links_each. But being new to Rails, I need
help.
Thanks,
Yash
--
Posted via http://www.ruby-forum.com/.
2006 Feb 15
9
newbie-> help understanding "magic" behavior
I am trying out ROR for the first time[1], and have much PHP poisoning
to overcome in my mental baggage. That said, I was delighted to find
that I could make a link from a "show" page to the next record in the
database by simply adding
@next_page = Content.find(params["id"].next)
to my content_controller.rb and then constructing a link to it within
my show.rhtml.
The