similar to: Content-type on render :file

Displaying 20 results from an estimated 5000 matches similar to: "Content-type on render :file"

2006 Mar 23
5
Dirt simple .rcss templates
There was some discussion on this list recently about doing .rcss templates in Rails using a custom template handler. I''ve come up with a very simple way to support rcss without a handler. Turns out all it takes is a route and an action that calls render(:file...). I put a full write-up on my blog earlier today:
2006 Aug 03
1
Using instance variables in CSS
What suggestions do you guys have for using instance variables in CSS? I suppose I could just include a partial with style tags, but I''m looking for something a little more elegant. I found this: http://rcss.rubyforge.org/ Has anyone used it? -- Posted via http://www.ruby-forum.com/.
2006 Mar 03
17
RCSS problems
Hi List! Following http://rcss.rubyforge.org/files/README.html, I''m trying to get RCSS to work with Rails. The rcss command itself works fine, but when trying to access http://localhost:3000/rcss/test.css I always get "Unknown action - No action responded to test.css", which I don''t understand since the route and controller are in place. Anyway, hopefully this is
2006 Jul 14
3
css in builder
Hello, I''m reading the builder project API (http://builder.rubyforge.org/), but I don''t find the answer to my question: Wich is the file name for CSS templates? (like RXML to XML). -- Daniel H
2006 Mar 22
5
Adding Custom templates?
Hi, does anybody have any pointers on where to look to learn how to write custom dynamic templates? Agile is a little sparse on this (but otherwise superb)! Thanx -- Posted via http://www.ruby-forum.com/.
2008 Apr 15
0
How to cache dynamic CSS (RCSS)?
Hi, I''m using this tutorial: http://blog.hasmanythrough.com/2006/3/23/dirt-simple-rcss-templates to make dynamic CSS files. However I can''t figure out how expire cached CSS files. Here''s my code: http://pastie.caboo.se/181021. Most of it is copied from the tutorial. Files are cached properly - i.e. <%= stylesheet_link_tag "main" %> generates
2006 Apr 02
6
Neat style trick
Not terribly exciting, but I was happy to think of it. I needed a div with a fixed height that could vary depending on page content. So I did this: <div class="listcntnr" style="height: <%= @users.size / 2 * 125%>px"> Whee! --Al Evans -- Posted via http://www.ruby-forum.com/.
2007 Aug 21
1
Render template not matching absolute path
Hi I have a simple controller method like this: class StylesheetsController < ApplicationController layout nil session :off def gap site = Site.find_by_hostname(request.host) @colours = site.colours respond_to do |accepts| accepts.css { render :file => "#{RAILS_ROOT}/app/views/ stylesheets/gap.rcss" } end end end And I want to test that
2006 Jul 10
7
What is has_many :through really buying you over HABTM?
So having just learned how to do has_many :through as opposed to HABTM, and then, being concerned that I wouldn''t get it to work, I started thinking about these two approaches. It seems to me that the _only_ problem that the HM:T (has_many :through) approach solves that HABTM doesn''t is the issue of the potential collision of id columns between your join table and one of
2006 Jun 04
1
Image links in stylesheets?
Guys, I understand the logic behind using image_tag in rhtml to maintain app portability, but how do you link to images in a stylesheet maintaining that same portability? Thanks for your help! B.A. -- B.A. Baracus: I thought you weren''t crazy no more? Murdock: Only on paper. -- Posted with http://DevLists.com. Sign up and save your mailbox.
2006 Jan 05
4
testing file uploads
Hi all, I was wondering about the class used when rails receives file uploads. Sometimes it appears to be a File, and other times it is a StringIO. Also it has methods such as original_filename that don''t appear to belong to either of these classes. I ask because I''m trying to work out how to test my fil upload related models and controllers. Is there some standardised way of
2005 Oct 18
1
Rcss - first public release
Hi All! My first contribution to Ruby/Rails community is ready. Here is short snippet from README as an overview: Rcss implements CSS-SSC (Server-side Constants) in Ruby. Main features: * Create rich CSS files using: - ERB templates - Server-side constants - Server-side classes (preliminary) * Simply add Rcss files to any Rails application * Process Rcss files off-line using command
2007 May 08
3
assert_difference eval magic in [6693]
I just saw Marcel''s change to assert_difference that changes the method API to take a string param that is evaled in a lambda. http://dev.rubyonrails.org/changeset/6693 I much preferred the old API, since it''s simple enough to pass a lambda. Passing a string means the lambda is in the wrong scope and doesn''t have access to objects in the test case scope. For an
2006 May 28
7
Join table not being populated
Hello, I have the usual Categories and Products table scenario, mediated by a Categories_Products join table. When I create a new Product and into a given Category, I notice that my join table is not being populated. Shouldn''t the join Categories_Products table be populated? Thanks, gk -- Posted via http://www.ruby-forum.com/.
2006 May 21
3
has_many :through with a polymorphic join
Hi, Four tables: users, user_counties, uk_counties and us_counties. Each user has many counties, and each county has many users, so I decided to make user_counties a polymorph, so it can have counties from different countries (each country requires a completely different set of tables with a completely different set of properties, that''s why there''s one table for uk_counties and
2006 May 10
7
has_many :through scope on join attribute
Hi I have a has_many :through. It''s a basic mapping of Project id .... User id .... TeamMembers project_id user_id role What I would like to do is have different roles so I can have in the project model has_many :core_members, :through => :team_members, :source => :user but I would like to limit this to only those with the "core" role in the team members table for
2006 Apr 09
4
Inheritance via Though Associations?
I posted something about this a week ago wihtout response, but have made some progress since. However, I''m still not getting exactly what I want. OK, three core tables: create_table :reference_items do |t| t.column :title, :string, :limit => 255 t.column :year, :integer, :limit => 4 t.column :type, :string t.column
2006 Jul 28
11
Forum
Im making forum and i have problem with paths. Here is code: http://pastie.caboo.se/6389 With this code, it works. But its a bit weird to use so many paths function. For every path i need to make new function. So can you suggest me something. Tables are like here: http://wiki.rubyonrails.com/rails/pages/ForumExample -- Posted via http://www.ruby-forum.com/.
2006 Jul 10
10
has_many :through and foreign key parameters
I just took my HABTM and turned it into a :through since my join table has another "non-joiny" attribute. I went from this: has_many_and_belongs_to :jobs, :join_table => ''tablename'', :foreign_key => ''x'', :association_foreign_key => ''y'' to this: has_many :jobs, :through =>
2008 Jun 15
11
Ouch! Can't figure out this file upload issue...
Okay, so this is driving me crazy. I''m trying to do a file upload using code from a book. What happens: I get wrong number of arguments (1 for 0) in the upload controller save action. No idea why. Schema: The schema for the picture model object is just a textfield named comments and a binary field called data. Upload controller: def get @picture =Picture.new end def save