Skip to content

Instantly share code, notes, and snippets.

<script>
$ = jQuery;
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
<script>
jQuery.noConflict(true); // this will unset $
</script>
function reload_post_grid_items(url) {
if (!url) {
var url = window.location.pathname + '?' + jQuery('#bwp-post-grid-form').serialize();
}
jQuery('#bwp-post-grid-items > *').fadeOut('slow');
jQuery('#bwp-post-grid-items').load(url + ' ' + '#bwp-post-grid-items > *', function () {
register_event_handlers();
jQuery('#bwp-post-grid-items > *').fadeIn('slow');
});
from pprint import pprint
DUPES_FILE = './dupes.txt'
def process_dupes(dupes_file):
groups = [[]]
index = 0
for line in dupes_file:
if line != '\n':
path = line.split(' ')[1]
groups[index].append(path)
# the model
class Setting(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, nullable=False)
description = db.Column(db.String)
value_type = db.Column(db.String)
value = db.Column(db.String, nullable=False)
def get(name):
setting = db.session.query(Setting).filter(
foreach ($_GET as $get) {
foreach ($tax_names as $tax) {
if (isset($_GET['spg_'.$tax->name])) {
$remove_filter = '<input type="button" onclick="window.location=\''.get_the_permalink().'\';" class="button button-submit" value="'.__("Remove Filter","infiwebs").'"/>';
$display = 'tax_query';
$posts_from_filter[] = array(
'taxonomy' => $tax->name,
'field' => 'slug',
'terms' => $_GET['spg_'.$tax->name]
);
post :create, {project: attributes_for(:project)}
assert_redirected_to project_path
Showing /home/blaine/administrate/app/views/administrate/application/index.html.erb where line #50 raised:
undefined method `new_admin_blogplugin/article_path' for #<#<Class:0x0000000589c588>:0x000000058985f0>
Did you mean? new_admin_blogplugin_article_path
new_admin_blogplugin_article_url
new_admin_project_path
admin_blogplugin_article_path
new_admin_user_path
edit_admin_blogplugin_article_path
admin_blogplugin_articles_path
When I request this path: /admin/blogplugin/articles
I get the error: uninitialized constant Admin::Blogplugin
the routes:
namespace :admin do
resources :users
resources :projects
/home/blaine/.rvm/gems/ruby-2.3.0/gems/administrate-0.1.5/lib/generators/administrate/dashboard/dashboard_generator.rb:107:in
`const_get': uninitialized constant BlogpluginArticle (NameError)
# first way
root to: 'blogit/posts#index' # says root_path undefined in layout
# trying another way...
mount Blogit::Engine => "/blog" # make sure the engine is mounted before calling root method
root controller: Blogit::Posts, action: :index
# says root_path undefined in layout
output of rake routes:
Routes for Blogit::Engine: