Displaying 20 results from an estimated 2000 matches similar to: "lame newbie question: how to pass instance variables"
2006 Mar 28
1
Simple Sidebar Solutions: How does yours work?
I''m working on a simple photo gallery app for personal use and I want to
generalize the sidebar such that in any page (controller or view, I''m
not sure which) I can dynamically add either
1. links to a given sidebar
2. or an entire sidebar.
I know that typo does this, and I''ve looked the code. I think it''s too
complex a solution for my simple site.
2006 May 05
8
pdf/writer: table.render_on best practices?
Hi All,
I generate a pdf report that contains a table. The report is 14 pages, and
it takes 20s to be rendered. Most of these 20s are spend in the render_on
method. I wonder if it is possible to speed up that process?
To create the report, I do the following:
1) Setup pdf layout:
# Setup pdf layout
pdf.select_font("Helvetica", { :encoding => "WinAnsiEncoding"})
2008 Aug 20
6
Too many opened files....samba 3.0.28a
An XP client is having an issue with my 3.0.28a server. They do not have this problem on a native w2003 file server with the same amount of data.
[2008/08/20 13:25:14, 5] smbd/dir.c:OpenDir(1079)
OpenDir: Can't open DowningShotgun/DowningTest/DowningTest.files/sample. Too many open files
[2008/08/20 13:25:14, 3] smbd/filename.c:scan_directory(586)
scan dir didn't open dir
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,
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
2006 Apr 06
6
pagination question
i''ve figured out how to use the next and previous links with the
paginator class but now i''m trying to figure out how to display all the
page numbers in between. looking through the rails api, i found
paginator.each() but i''m not sure how to use it, or if that''s even what
i am looking for.
also, is there a way to limit the amount of pages like some sites
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/.
2002 May 09
2
Trouble with banking software on Samba share
Hello list members!
I joined this list on May 1st and I can see I have a lot to learn. Thanks
to everyone - especially those *@samba.org folks. You are so appreciated.
Background in my plea for help: I'm the IT guy for a family owned community
bank in Southern Colorado. I am very tired of the limitations and security
problems of Micro$oft and have committed to learning and using Linux
2006 Apr 20
3
How to restrict access to images by user?
Hi,
I have a some image files that belongs to some users. Only the owner of an
image should be able to see it.
How can I do that?
I don''t think I can use send_data, because I want the image to be displayed
on a "rendered" page. I don''t think I can place the images in the public
folder, because if some user can figure out the name of the image then he''ll
be
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 Mar 22
3
Anyone using Theme Generator
Im working on a simple private Rails app, but I''m not much of a designer
and I''m struggling to get a nice layout.
So I was thinking of using this Theme Generator:
http://www.mattmccray.com/archives/2005/10/26/full-theme-support-in-rails-revisited/
Does anyone have any experience with this?
Is it working in the latest versions of Rails? (1.0)
Is it worthwhile even for a
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 May 14
4
searching on foreing keys
Hey all,
I''m using a simple search function. It''s working
great except for foreign keys.
I have one table pets (id,name,owner_id)
and another table people(id,name)
owner_id being a foreign key of pet pointing to people name.
here it is on the pet controller:
@paginator, @pets= paginate(:pets, :conditions =>["name OR owner_id
like
2006 Jul 31
1
Pagination of Complex Queries
I''ve created a class method in my model called find_filtered. The intent is
that I take various params that the user has submitted, and let the model
build the query and return the AR collection, which is exactly what happens.
However, now I''d like to paginate the recordset. Everything I''ve been able
to find about pagination presumes that you have no pre-existing AR
2006 Feb 28
7
windows sqlite client?
Hi all,
Does anyone know a good windows client for sqlite 3? typical use is create
and modify tables and export creation queries.
Thanks,
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060228/363834cf/attachment.html
2005 Dec 22
2
Documentation for generate controller
I can find the API documentation, but where is the documentation for the
standard generators. The wiki has 3rd party generators- but I want to
know specifically what generate controller does, and how it differs from
generate scaffold, and what other generators there are.
Where is this succinctly documented?
--
Posted via http://www.ruby-forum.com/.
2007 Dec 12
0
samba 3.0.26a and dropboxes
Hi
we have two fileserver based on FreeBSD:
-'old' based on FreeBSD 5.4 with samba 3.0.14a
-'new' based on FreeBSD 6.2 with samba 3.0.26a
both samba are built from ports.
We are migrating from 'old' to 'new'.
But we found a problem.
---
We have some 'group dropboxes' on both servers: these are unix
directories with permission 7773.
The 'sender' (he
2007 Apr 04
2
[PLUGIN] ArPaginator - Allows you to easily paginate over any existing AR queries.
The built-in Rails pagination is fairly limited...you pass in the
model name, and optionally some conditions, and it generates a
paginated query for you. This gets to be very bad if you''ve got any
custom queries.
class Company < ActiveRecord::Base
def complete_videos
Video.find :all, :conditions => "company_id=#{id} AND
status=''complete''", :order
2006 Mar 21
2
Rails newbie can''t initialize a new Paginator object
Hi all,
I''m using ruby 1.8.2-15 and a recent rails 1.0 download.
I''m trying to implement the Classic/Custom pagination in a list action.
Here''s my code:
def list
getSearchTerms
# NOTE: @params[:search_results] is an Array of product_data objects
# returned by a search action.
@results = @params[:search_results]
if @results.nil? then
# The default
2006 Apr 27
2
How to override pagination_links method
I intend to override pagination_links method.
I added following lines of code in application_helper.rb
module ActionView
module Helpers
def pagination_links(paginator, options={}, html_options={})
raise("boom!!")
end
end
end
But my code is not executing my code. The view is still using the method
pagination_links from rails.
What''s the correct way to override