Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue while creating new post #47

Closed
ashishevontech opened this issue Oct 31, 2014 · 16 comments
Closed

Issue while creating new post #47

ashishevontech opened this issue Oct 31, 2014 · 16 comments

Comments

@ashishevontech
Copy link

I have used this gem for my appliaction and its configured fine.
I have posts and on that each post comments will be given by users.These posts will be created by admin[rails_admin gem].
While creating new post by admin it is giving me following error:
ActionController::UrlGenerationError at /post/new
No route matches {:action=>"show", :controller=>"rails_admin/main", :id=>nil, :model_name=>"commontator~thread"}

Please help me on this?

@Dantemss
Copy link
Member

It seems the model_name is wrong? For some reason you have a tilde in commontator~thread

But without knowing which code tries to use this URL, I can't say much more

@ashishevontech
Copy link
Author

Thanks Dantemss for the reply.
This error is coming when I am creating new post from rails_admin gem.

I am using rails_admin gem for admin section which will create posts. Once post will created then it will be visible at user's end where user can comment on it.

So my question is:
1.Is there any setting we have to for rails_admin?
2. Is it work with rails_admin gem at all?

@Dantemss
Copy link
Member

Dantemss commented Nov 3, 2014

I'm not familiar with the rails_admin gem so I cannot say for sure if it's compatible.

I assume you can configure rails_admin to ignore the commontator_thread relation, and all should be fine? Take a look at https://github.com/sferik/rails_admin/wiki/Railsadmin-DSL

@Abacaxi-Nelson
Copy link

Hi, same issue here.
Do you find a workaround ?

Thank you,

@ashishevontech
Copy link
Author

Hi.. still struggling to make it work with rails_admin

@Dantemss
Copy link
Member

So have you tried excluding the commontator_thread field like I suggested? Did it work?

RailsAdmin.config do |config|
  config.model 'YourModel' do
    list do # or edit or export
      exclude_fields :commontator_thread
    end
  end
end

@Abacaxi-Nelson
Copy link

Same issue with :

config.model 'Venue' do
     list do # or edit or export
        exclude_fields :commontator_thread
    end
end

Thanks

@Dantemss
Copy link
Member

I assume it still doesn't work even when you change list to edit?

@Abacaxi-Nelson
Copy link

Yes it doesn't change anything...

@Dantemss
Copy link
Member

Hello. I have identified the issue. rails_admin did not like the way commontator created threads.
I have released a new version (4.10.0). This should fix the issue. Please let me know how it goes.

@Abacaxi-Nelson
Copy link

Works for me :)

@Dantemss
Copy link
Member

Nice :D

@Dantemss
Copy link
Member

Fixed in 4.10.0 so I'm closing this.

@harin
Copy link

harin commented Oct 26, 2015

Still have the same problem in 4.10.5

@mauriciokj
Copy link

change to

exclude_fields :thread

@Gravity-vV
Copy link

so how did you figure out the issue finally,and i while get the same issue when i add the acts_as_commontable in my model,whats the mean of v4.10.0. is it a gem you published in your repository ? it stuck me several days . now to inquire you. thanks too much )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants