Hello,
I would like to have individuals config for my rails apps on my server, using passenger. How to do it ? For example, I want to have different PassengerPoolIdleTime ...
I'm using application.html.erb in the views/layouts folder of my Ruby on Rails web app as a template. But there's one page in which I don't want the template to be used. Is this possible?
Is there a way to get a report of how long each test is taking to run on a Ruby on Rails project? I have a a small set of tests, 2 or 3, which take about 50% of the time and I'd like to find out which ones are.
If using HAML on Ruby on Rails, then
:sass
#someDiv
border: 3px dashed orange
won't have any <style> tag around them.
and then
:css
:sass
#someDiv
border: 3px dashed orange
won't kick on the :sass filter, but
:css
:sass
#someDiv
border: 3px dashed orange
will kick on the :sass filter, but it is outside of the <style> tag. So how can the :sass filter be used?
I'd like to implement measurement unit preferences in a Ruby on Rails app.
For instance, the user should be able to select between displaying distances in miles or in kilometers. And, obviously, not only displaying, but entering values, too.
I suppose all values should be stored in one global measurement system to simplify calculations.
Are there any drop-in solutions for this? Or should I maybe write my own?
Which is better source control with NetBeans (Ruby on Rails), VSS or subversion?
I want to use source control, so I want to know which is better for NetBeans (RoR). Visual Source safe or Subversion?
I'm looking to convert single digit numbers to two-digit numbers like so:
9 ==> 09
5 ==> 05
12 == 12
4 ==> 04
I figure I could put a bunch of if-else statements (if number is under 10, then do a gsub) but figure that's horrible coding. I know Rails has number_with_precision but I see that it only applies to decimal numbers. Any ideas on how to convert single-digits to two-digits?
I have a rails application which acts differently depending on what domain it's accessed at (for example www.myapp.com will invoke differently to user.myapp.com). In production use this all works fine but my test code always sees a hostname of "www.example.com".
Is there a clean way of having a test specify the hostname it's pretending to access?
I see errors in my application like this from the web browser
RuntimeError in RootController#raise_error
Error test
which I'd like to hide and just redirect to a static error page. What's the standard way to do that in Rails?
Hi,
We have discussion in my job place about question (We use 1 of the php frameworks):
Why program with php frameworks big web application if it can be done better with rubi on rails, python or java?
Please say our opinion
thanks
In Ruby on Rails,
http://localhost:3000/foobars/alt/1
works
but
http://localhost:3000/foobars/alt/1.xml
doesn't work.
config/route.rb is
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
so supposedly it supports an id.format in the URL?
I have a gallery in my rails app that needs to only allow certain images to be shown to specific logged in users. I am using Paperclip for image processing now, but it saves all images in a public folder available to anyone.
Is it possible to only allow these images to be served to authenticated users?
Rails 3 does some cool stuff to make Javascript unobtrusive, so they've done things like this:
= link_to "Logout", user_session_path, :method => :delete
..converts to
<a href="/logout" data-method="delete" rel="nofollow">Logout</a>
But it just occurred to me.. When I turn off javascript the method isn't DELETE anymore, it's GET as expected. So are there plans to, or is there some way to, allow these data- attributes to degrade gracefully, so that link still is a DELETE request?
What is the best way to implement real time updates in ruby on rails using node.js? It would be great to hear either real examples or your thoughts on alternative solutions.
It is said that FastCGI doesn't work well with Ruby on Rails deployment. Why is that? In previous experience, something either works quite well or it might be fundamentally wrong. So if FastCGI is a viable solution, why is it not reliable with RoR?
Does FastCGI work well with most any language / frameworks?
How do projects like BrowserCMS for Rails implement version control for a CMS? What is best practice for version control with database content? How does it relate to git/svn?
Hi,
I'm trying to get Rails to capitalize the first character of a string, and leave all the others the way they are. I'm running into a problem where "i'm from New York" gets turned into "I'm from new york."
What method would I use to select the first character?
Thanks
i have my constants initialized in environment.rb like this :
Rails::Initializer.run do |config|
...
MAX_BID = 10
end
i would like to use this constant in my models and views,what is the correct syntax?
if a use it a model its says
NameError: uninitialized constant User::MAX_BID
i understand that it is looking for the constant inside the model , how can i tell explicitly that this constant is in the environment?
thanks
I'd like to add a begin...rescue block to one of my controllers create method, in order to log better info and construct the correct error message to return to the client. Does the rescue in any way 'interrupt' the rollback process?
I'm assuming rails automatically does a rollback. When does it happen? Has it already happened by the time I get in the rescue clause?
I'm using mySQL on Dreamhost and I think they use innoDB.
In a rails project how would I create a picture slideshow? It could be generated as flash or use prototype or something else.
I just want a series of images (as a sub-part of a web page, not be the whole page) to fade into each other, and to advance manually if clicked. It would be nice if I could do things like slowly zoom into the images
I imagine there must be a plugin or something to handle this?
I've got a standard Rails app with Nginx and Mongrel running at http://mydomain. I need to run a Wordpress blog at http://mydomain.com/blog. My preference would be to host the blog in Apache running on either the same server or a separate box but I don't want the user to see a different server in the URL. Is that possible and if not, what would you recommend to accomplish the goal?