similar to: API Suggestion

Displaying 20 results from an estimated 20000 matches similar to: "API Suggestion"

2006 Mar 07
6
form_tag - directing to new target window
How do I use... <%= link_to "All Facilities", :action => ''fac_log_all'' %> if I add :target => "_new" that is just a parameter and not a directive. I just want reports to print into a separate window. How do I do that? It''s not clear at all to me Craig
2006 May 25
4
How to add a migration with a plugin?
I''m working on a plugin that requires some database support to do its job (adding a model or two). I''d like the plugin to automatically add a migration once it is installed. Is there already a mechanism for this? If so, how do you do it? -- *Berin Loritsch* Owner *Work:* 571-215-7708 *Email:* bloritsch@d-haven.com <mailto:bloritsch@d-haven.com> *IM:*
2006 Jul 27
2
ActiveRecord retrieval style? Lazy initialtization?
I''m using ActiveRecord for an Extract and Transform operation, so it is outside of its native environment of Rails. I am running into a problem with memory consumption when I retrieve large amounts of data. By large amounts I am talking about roughly 12,700 records that each have a one to many relationship with about 15 additional types of information. One of those types happens
2006 Feb 23
4
looping
I have a form that prints fine for one particular criteria... facility_id = "X" controller code looks like this... def fac_log @facility = Facility.find(params[:report][:facility_id]) @placement = Placement.find(:all, :conditions => [ "facility_id = ? and discharge_date IS NULL, params[:report][:facility_id] ] ) end I can print out the form
2006 Mar 07
6
Anybody use Red|Blue Cloth?
Does anybody use and prefer Redcloth (or bluecloth, which appears to be alpha)? Does it affect performance much? Is there a way to get it to automatically process templates without having to call textilize? Thanks, Joe -- Posted via http://www.ruby-forum.com/.
2006 Mar 03
7
Workflow + Rails
Is there any project or solution for an easy integration of a WFE / WfMS into rails? I''m quite new to this topic, but I probably need a small subset of workflow patterns (or whatever the correct term is) only. Any pointers are welcome. -- Posted via http://www.ruby-forum.com/.
2006 Mar 08
3
ActiveRecord and Images
Not really a Rails question, but a "best practices" one. If I want to associate an image to every account in my application, is it better to insert the image file directly inside the db or to upload the image in public/images/ ? Also, if I want to associate a cover to a movie, what''s the best approach ? TIA, ngw -- Nicholas Wieland nicholas_wieland@yahoo.it
2006 Mar 04
13
file_column
Restricting size of an uploaded file, is how is that possible? If I do not want a user to upload a file larger than X bytes, can it easily be done? If I also would like restrict the types of files that can be uploaded, how may I do so? Thank you, Sharkie
2006 Mar 06
20
How painful is the 1.0 -> 1.1 upgrade going to be?
Does anyone have a sense for how painful the 1.0 -> 1.1 upgrade is going to be for existing apps? I''m finishing up my first real RoR application with Rails 1.0. I can live with it staying at that level, but I really want to use the has_many :through attribute to clean up some of my code. I''m not particularly interested in edge Rails, mainly because the documentation for
2006 Apr 24
2
link_to external link
I have searched through the api several times through and can''t seem to find this. <%= link_to ''Help'', {:url => ''https://www.example.com/page?AppServeHelp''}, {:target => "_new"} %> but this doesn''t work as it still prepends the current server/controller space on the url itself. How do I accomplish this? Thanks Craig
2006 Mar 07
6
how to add onchange javascript event to select field
I would like to add javascript ''onChange'' event handling for a select field, such as <%= collection_select("job", "client_id" , @clients, "id", "name") %> with onChange="xxx" Anyone know how to make this work? Thank you, Scott -- Posted via http://www.ruby-forum.com/.
2010 May 13
1
link_to using smart API
Trying to use the "smart" API for link_to def create_link(object, label = nil) label ||= auth_labels[:new] link = link_to(label, [:new, object]) if can?(:create, object) link.sub /new\./, ''new/'' end But this generates a link like /projects/new.1 , instead of /projects/ new I would assume it would make sense to pass it the class instead, like this, sense in
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 Mar 07
6
Flickr - Tutorial
So I''ve pretty much followed the steps in the video tutorial on RoR.com for creating a small app, to search for photos on flickr.com - all is good, and works as intended to.. How would I go about adding validation, so if no tags are specified it will fail. I know I have to use validates_presence_of :tags - but not in the controller.. so I tried to generate a model called
2006 Mar 02
4
Getting Acts_as_Paranoid to work with validates_uniqueness_of
Hello I''ve been using Acts_as_Parnoid for a while and it has been working well but I am now having a slight issue with it. I have a company table were I would like to use validates_uniqueness_of :company_name. This validation works if a company exists in the database and has not been deleted. However, I also would like the validates_uniqueness_of to work if a company has
2006 Mar 06
5
Question about file_column plugin
Hi! File_column plugin saves uploaded files to "public/model/image/model_id/filename", if i understand it correctly. Does it mean that it creates new folder for every image? I have product (model) that has_many images (model). Is it possible to use (or modify) this plugin that it would save my images to different folder, so the id of the model_id part would be id of the product
2006 Feb 08
7
DRY methodology
because I am a grasshopper... Now that I can sort my ''list''...is there a logical way of not repeating myself to having essentially the same list view with multiple sorts? i.e. def list_cl # ordered by clients last name @placement_pages, @placements = paginate( :placements, :include => [:client], :order_by =>
2005 Jul 16
2
Applying css style to a link_to
What is the proper syntax to apply a css class to a link created using link_to? I''ve tried <%= link_to("details", :class => "details", :action => "edit", :id => event) %> but that creates a link which looks like /admin/events/edit/3?class=details which is not what I''m looking for. Kyle Heon
2006 Apr 04
2
How to apply class from Stylesheet to "link_to" element???
Hi, This is the "img" class for anchor element inside my stylesheet. ===================== A.img:link { color: #ffffff; text-decoration: none; } A.img:visited { color: #ffffff; text-decoration: none; } ====================== I can easily apply this tag inside my html document as follows:- ======= < a href="goodbye.html" class="img"> ======= Now I want to
2012 Apr 23
1
Searching and returning arrays
im a begginer in RoR and am using rails 3.2.3 and ruby 1.8.7 This forum has helped me to progress but I''m confused by one thing. My app is supposed to allow seaching for results depending on the check boxes that are checked. In my case, when the user checks a determined facility and clicks "search" the corresponding hotels with only those facilities should be returned. I can