search for: use_slug

Displaying 2 results from an estimated 2 matches for "use_slug".

Did you mean: use_sg
2011 Aug 04
3
#create tests fail when I add FriendlyId to my model
...valid(BrandsControllerTest): FriendlyId::BlankError: FriendlyId::BlankError app/controllers/brands_controller.rb:16:in `create'' test/functional/brands_controller_test.rb:27:in `test_create_valid'' Here''s the relevant line in brand.rb: has_friendly_id :name, :use_slug => true, :approximate_ascii => true Here''s the test (using mocha): def test_create_valid Brand.any_instance.stubs(:valid?).returns(true) post :create assert_redirected_to brand_url(assigns(:brand)) end Here''s the fixture: one: name: MyString im...
2009 Feb 19
0
friendly_id / acts_as_referenced conflict?
...renced_column => "permalink" end I would now like to use friendly_id to create seo friendly URLs instead of using the id. I now have: # property.rb class Property < ActiveRecord::Base acts_as_referenced :referenced_column => "permalink" has_friendly_id :permalink, :use_slug => true end The above code generates a "slug text is blank" error - I assume this is due to acts_as_referenced using a before_save callback to generate the permalink which friendly_id is looking for. Is it possible to get the two plugins working together? Initialize the acts_as_refer...