ruby-on-rails-3
Rails how to allways gsub column before save?
I am trying to make gsub on my column before save or update. Here is my controller: def dansk(text) self.text.gsub(\'å\', \'å\')[详细]
2023-04-13 07:37 分类:问答flash notice persisting in rails controller
I\'ve got a controller with an update method that updates the model attribute, sets a flash notice for the user if successful and then renders the edit page again. The next link I click on the same fl[详细]
2023-04-13 07:33 分类:问答Updating attributes on several indexes in array. Using mongoid in Rails 3
Inside my test database, I would like to trigger a \"new_item\" flag for testing.The method already works in my tests.So now I am setting the created_at and published_at fields of all records to 1 mon[详细]
2023-04-13 06:02 分类:问答Rails 3 has_many :through + join table conditions / scoping
I\'m working on an app that has the models User and Project, and User can be assigned to multiple Projects, via ProjectUser, with a role (e.g. Developer, Designer).[详细]
2023-04-13 05:53 分类:问答Adding urls api keys in environment variable in ruby
I have a url that I am using in one of the controllers. Is there a better place to put this url? The url uses an API key and I was wondering if there is a better place to add this url and/or api key s[详细]
2023-04-13 05:45 分类:问答rails new project_name using rvm
I use rvm in my rails project and specify gem versions in the Gemfile. However, my problem right now is different. I want to create a rails 3.1 project using rails new project_name but my current ver[详细]
2023-04-13 05:37 分类:问答Customising error handling with rails3
I want to take control of the way rails handles the display of errors, I want to keep using the FormBuilder and I don\'t want to use Formtastic (Love formtastic but like all things helpful it\'s great[详细]
2023-04-13 05:29 分类:问答Rails 3.1: How do i add an initializer that runs after gem initializers?
My scaffold generator stopped working after we updated factory girl.Here\'s why happened.First, my config file tries to set up certain defaults for scaffold generation, like so:[详细]
2023-04-13 05:26 分类:问答Call a controller's method from an external ruby script
I\'m creating an external service of my rails app. This is always listening a rabbitmq queue and all their messages should be redirected to some methods of the rails controllers.[详细]
2023-04-13 05:20 分类:问答Using on_the_spot gem immediately logs out user
I have finally gotten the on_the_spot gem working in my rails app, which uses devise for authentication.[详细]
2023-04-13 05:18 分类:问答