Could anyone help with this problem:
Upon "create", the user is redirected to the url: model/model_id (eg post/1), instead I am redirected to models/url_encoding_object (eg posts/.%23) and there is an "406 Not Acceptable" message in the console.
Typically, upon create, the console's message is "Processing PostsController#create (for 000.0.0.0 at 2009-11-23 12:32:52) [POST]", but with this error, the message is "Processing PostsController#create to # (for 000.0.0.0 at 2009-11-23 12:32:52) [POST]"
I've seen austinfromboston's response and tried his "old fashioned but effective" solution to that similar problem, but it doesn't work for me.
Any help would be greatly appreciated
Controller Code:
# POST /groups
# POST /groups.xml
def create
@group = Group.new(params[:group])
@group.category = params[:category]
@group.user = current_user
#here we add the current user to the membership collection of the group
@membership = @group.memberships.build(params[:membership])
@membership.group = @group
@membership.user = current_user
@membership.initiator = false
@membership.membership_status_id = 2
#and here we set the current_user as the owner of the group
@group_permission = @group.group_permissions.build(params[:group_permission])
@group_permission.membership = @membership
@group_permission.group_role = GroupRole.find_by_name('Owner')
unless params[:metro_area_id].blank?
@group.metro_area = MetroArea.find(params[:metro_area_id])
@group.state = (@group.metro_area && @group.metro_area.state) ?
@group.metro_area.state : nil
@group.country = @group.metro_area.country if (@group.metro_area &&
@group.metro_area.country)
else
@group.metro_area = @group.state = @group.country = nil
end
@group.tag_list = params[:tag_list] || ''
# unless @user.is_in_group?(@group)
# @user.memberships << @group
# end
respond_to do |format|
if @group.save
flash[:notice] = :group_was_successfully_created.l
format.html { redirect_to(group_path(@group.id)) }
else
format.html {
@metro_areas, @states = setup_metro_area_choices_for(@group)
if params[:metro_area_id]
@metro_area_id = params[:metro_area_id].to_i
@state_id = params[:state_id].to_i
@country_id = params[:country_id].to_i
end
render :action => "new"
}
end
end
end