How do I extend the user summary with Plugin Store data


(Tim McHugh) #1

Hi, I’m trying to create a plugin that will enable users to endorse each other (writing a brief testimonial for someone else). The results I am going for is pictured below :point_down:

I am thinking to add a section to the user Summary page that houses a user’s endorsements and enables users to create new endorsements.

I am having trouble figuring out how to extend the user summary with Plugin Store data. If I could get the data loaded initially, it seems straightforward enough to use actions in the controller for other CRUD. The challenge right now is getting that data into the view initially. How might I go about this?

I have tried extending the Controller, which seems like the wrong place to be fetching that data.

It seems like extending the user_summary.rb model is the place to be doing this, but I am confused as to how to get that data from the Plugin Store and serialize it (?) and get it into the view.

Can you help me?


(Vinoth Kannan) #2

#plugin:solved extends user_summary page to display solved_count value. Here you can use PluginStore data instead of UserAction.

Also a similar plugin is already exist in GitHub


(Tim McHugh) #3

Thanks for the quick reply @vinothkannans. This #plugin:solved example is helpful and wow, I searched for plugins similar and failed to find @jafeth.diazc’s plugin, thanks for pointing that out!


(Jeff Atwood) #4

Wow that one star review is brutal. :rofl: