if somebody type URL/frewfrefew, he gets a routing error.
how do i get this invalids routes to point to the main page of the application in Rails.
thnaks
I'm currently working on a largish Ruby on Rails project. It's old enough and big enough that it's not clear if all views are actually in use.
Is there any script/plugin out there that can generate a list of unused view files?
Hi,
I have a list of rows in an excel sheet which I need to load as historical transactions into a table in my rails applications. I saved the excel file as a csv file. I tried using csv from the standard library but keep getting the following exception CSV::IllegalFormatError.
Not sure how to even figure out where the problem lies. Any suggestions on how to do this.
thanks,
ash
Hi, I want to add a revision counter to my rails app.
Not the number of commits necessary but the number of live pushes/deployments for example.
I'm using github as my remote repo.
Any suggestions?
Thanks
I have both a text_field and a text_area in Rails, and I want to disable the browser's auto-complete. Setting the attribute in either the text_field, text_area, or in the form itself, doesn't seem to make the browser stop trying to auto-complete. This is for Firefox 3.6.3 on OS X. Maybe it's more a browser issue than a RoR issue.
Thanks!
Has accept_nested_attributes_for already works with Rails 2.3.5 and Ruby 1.9.1????
I keep getting this error
undefined method accept_nested_attributes_for' for #<Class:0x00000108da2140>
I'm trying put an if statement directly into a select field in rails, with no success.
Here is what I've tried:
<%= f.select (:book_id,{
if @a!=1
"Harry Potter", 1,
end
if @b!=2
"Lord of the Rings", 2,
end
end %>`
Any ideas?
My original question and accepted solution was posted here: http://stackoverflow.com/questions/2483640/rails-association-question. Check that out first.
My follow-up question is this:
I want to return an object that has both the user attributes and the race attributes. That way I can access, for example, the user's name and the fastest_time. How can this be accomplished? I've tried several approaches, but none I've been satisfied with.
Hi...In Rails, is it ok to define logic in a controller with a model. For example, take there is an User Model, which is good design.
1)Leaving the UserModel with the CRUD models and moving all the other User Specific actions to a separate controller or
2)Add the user specific actions to the same UserModels
Thanks :)
Hi, I am new to ruby on rails.
I want to build an RSS feed aggregator.
How do I find out the trending topics from the stream of data[titles] from various RSS feeds.
Could you help me how to achieve this??
Looking forward for your help
Thanks in advance
Gautam
Hi folks, i have a function that converts an array to a hash which i would like to use across all the model, controller and view files in the rails app.
Does this violate some core design principle, or am i missing something really obvious?
Is it possible to configure rails to show logger.debug messages (from logger.debug statements inside controllers) to display inside test.log (or to the console) when running unit and functional tests?
I added the following to test_helper.rb. I see messages from logger.debug statements directly inside tests but no messages from logger statements inside controller methods?
def logger
RAILS_DEFAULT_LOGGER
end
Is it possible to do a redirect in the routes file of a Rails app?
Specifically, I'd like to forward /j/e to /javascripts/embed.js
Right now the only way I can think to do it is to create a j controller with an e method that redirects to that.
can't seem to get my seeds.rb file to run through the command "rake db:seed". I'm using netbeans and I'm a beginner to rails, so I could be doing something really simple and stupid =/. I know you're meant to put your seeds.rb file in the db directory but netbeans doesn't seem to have one or might have renamed it... any help out there?
Thanks in advance!
I've installed just about every library/gem that I could find for memcached/memcache, but everytime I attempt to run my application I get this error:
Error message:
uninitialized constant Rails::Initializer::MemCache
Exception class:
NameError
I have tried $ telnet localhost 11211 and memcached is definitely running. Any ideas?
(I'm running Apache2/Passenger)
Hey,
where would I place additions to stdlib classes in a rails project? Let's say something like:
class Date
def foo
'foo'
end
end
I thought about the initializer folder but it somehow felt wrong. Ideas?
Tried doing http://davidwparker.com/2008/09/17/site-wide-announcements-in-rails-using-jquery-jgrowl/
Am really bad with JS. Think I am messing up on the last part where it says "This code goes in your application.js file (somewhere in $(function){ //here })"
Am I not suppose to do a link_to_function and create a function with this code that references that link?
Really lost on this one.
I'm attempting to track my dependencies with git-submodules in my rails app. So far I've added submodules for things like, haml, shoulda, authlogic, etc to 'vendor/plugins'. I've seen indications that I should be using 'vendor/gems' instead though.
Question, which directory is the appropriate place to put dependencies being tracked as submodules? Is the choice arbitrary?
Thanks
Does anyone know how to make rspec follow a redirect (in a controller spec)? (e.g test/unit has follow_redirect!)
I have tried "follow_redirect!" and "follow_redirect" but only get
undefined method `follow_redirect!' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_1:0xb6df5294>
Hey everyone,
I am working on a simple blogging type ruby on rails application and I have everything working through tinyMCE for a nice WYSIWYG editor so the user can add some simple things like images/youtube videos and lists. What I am looking for is a nice solution for blacklisting certain elements to be filtered out of the data when it is displayed.
So is there a solution for this available as a gem or available to download anywhere?
Thanks!
Great ruby on rails examples of almost real world applications:
Can somebody give some links of sites that have such codes using the best practices in structure, implementing it, models, controllers, security, views, caching, modularizing and so on? thanks
Hello,
I am looking for ways to protect my product images and I don't know if there's anything out there better than what I've already found: disable right click, use a transparent image in front of your picture and watermarking. Obviously none of them is perfect but I was curious if someone came up with a better solution to this problem.
Also is there any rails plugin to aid with that ?
Thanks
hi guys,
i am wondering is there a convenient function in rails to convert string with negative signs into a number. e.g. -1005.32
when i use to_f method, the number will simply become 1005 with the negative sign and decimal part being ignored.
thanks in advance!