Code-Editor Plugin - asp.net-mvc

I'm looking to find some kind of plugin similar to this plugin stackoverflow uses to ask questions. Allowing the person who is asking the quesiton to customize his/her question with code, images, bold letters, etc..I like how it knows that your typing code when you tab once or twice for example. I would be using it for an mvc4 project to let users type tutorials with a little code in there description. I tried looking at code mirror but it seems way to complicated to use. Are there any simple ways or plugins I can implement something like this into a textarea or some kind of input? Thanks for any adice

Here's a few libraries that you can take a look at:
http://steamdev.com/snippet/
http://www.tinymce.com/
http://codemirror.net/
Personally I use the first one. They are all easy to implement though, what problem did you experience using codemirror?

FWIW, the editor that is used on StackOverflow is open source so you can incorporate it into the site you are working on. The editor uses markdown syntax instead of full on HTML (such as TinyMCE) so it's a little more limited in what kind of formatting it supports. Whether it serves your needs or not will depend on how rich an editing experience you need to provide and how complex the resulting output needs to be.

Related

Is it possible to have a select box with an input field option?

I want to have a select box that besides the given options allows to set a value manually. I am not a hundred percent sure if that is possible but I think I have seen it before. On the w3school page for select I couldn't find anything relevant.
As I am working Rails, I also checked the APIDock page for the select_tag form helper, but there I also couldn't find anything.
While it's a very common functionality, what you are looking for is not part of the standard HTML (5 or not) controls.
To achieve the desired effect you have to use a JavaScript framework.
The good news is that there are a lot of frameworks and/or plugins doing this. The bad news is that you will have to spend some time playing with a couple until you find one you're happy with.
The two most used JS frameworks, jQuery and Bootstrap, have dozens of plugins that does this, just search for them.

Creating a library application - which method to use?

I was hoping to get some advice. I want to create an application which is like a library that holds a lot of different information including documents, pics etc where a user can log in and search for different topics and see the definition of terminology. For example users would be able to click on the word 'electical current' and a definition of electrical current would appear with also links to supporting information. The user will not be allowed to edit any information only read it.
I am wondering what is the best language to use to do this? I know that storing all the information in a html file is definitely not the way to go. But I am not sure what to use - whether html linked to a database is a good option (I've heard that this is also not great because your database code is still accessible) or whether ror is a good option. I decided that ror would be a good framework to use but I still have some doubts such as:
the application will not be hosted on the internet but only on an intranet would ror still be good for this?
the 'site' is basically static except for a few users who will have admin access although it may have more user specific functions later on.
Any advice would be great. Thanks in advance.
It seems to me that a wiki type system would be fit for your purposes. You can create one without writing any code by using a free service such as Google Sites.
I agree with #Finbarr that your problem statement sounds like it could be solved by a wiki.
I suggest mediawiki since it is open source--you can add to it or change the core software if necessary.
Or any other opensource wiki could be used. See wikipedia article
Re: which language: your problem statement is pretty broad. From what you've told us, any language would do.
Best advice: find the open source wiki that most closely meets your needs and then learn the language that it was developed in. Usually that's php or perl. But you can also find Ruby on Rails wikis such as Instiki
Added: Welcome to Stack Overflow. Note that your question is quite broad. So it may get closed for not being specific enough. Stack Overflow is aimed at answering specific questions about software programming. See the faq.

Ruby on Rails customer-facing formbuilder?

I have a customer that wants to build their own questionnaires. Something like WuFoo (www.wufoo.com) but more secure and contained within the app.
I've looked at Smerf (http://github.com/springbok/smerf) which provides the yaml-to-form conversion, but I'd like something the user can use to create their own forms.
I would look at using active_scaffold. The main version has not been updated for Rails 3, but a fork at the location below has. I think it would work well for your purpose, you just need a way to grab the data and feed it in. Here is a demo of what it looks like when it is running:
https://github.com/vhochstein/active_scaffold
Here is a demo at the top of the page:
http://demo.activescaffold.com/roles
You could always embed Google Forms. Might be easier than reinventing the wheel. Unless you have some specific use case this doesn't cover?
If you are not adverse to going the Javascript route the then you might consider one of the many framework plugins like the JQuery Form Builder. From a usability perspective it seems to me that any good solution is going to involve some Javascript. There should be no reason why this approach wouldn't integrate well into a Rails backend
You might want to check out this one. Dynamic Forms
I too am looking for something very similar. What solution did you come up with?

What makes an effective URL Mapping implementation and why?

I am looking at implementing URLMapping for a personal project. I am already aware that solutions exist so please do not answer suggesting I should use one.
What I want is to harvest the opinions of fellow developers and web users on URL mapping implementations. Specially I would like you to answer:
Which is your favourite implementation?
What do you like about your favourite implementation?
What do you not like about your favourite implementation?
How would you improve it?
I would like you to answer from two points of view:
As a developer
As a user
I would be grateful for any opinions on this matter, thanks!
I've only worked with django's URLConf mechanism. I think the way it relies on the urlpatterns variable is a bit flimsy, but I like its expressiveness in specifying patterns and dispatching to other url configurations. I think probably the best thing is to figure out your URL scheme first, and then try out a couple of solutions to see what matches best. If you're going hard-core REST using the full complement of GET/POST/PUT/DELETE, and checking the user agent's Accept headers, and all that, django will, by default, have you splitting your logic between URL config files and view files, so it might not be the cleanest solution.
However, since it's all Python, you might be able to do some more complex processing before you assign to urlpatterns.
Really, you want a system that does what you need. Your URL scheme is your API, so don't compromise on it based on the tools you use. Figure out your API, then find the tools that will let you do that and get out of your way.
Edit: Also do a google search for "URL scheme design." I found this without much effort: http://www.gaffneyware.com/urldesign.htm. Not comprehensive, but some good advice gotten from looking at what flickr does.
Well, I should have noticed the url-routing tag shouldn't I? :-) Sorry about that.
jcd's experience mimics mine - Django is what I use too.
I like the fact that the routes for an app reside within the app (in urls.py) and can just be included into any projects that might make use of that app. I am comfortable with regular expressions, so having the routes be specified in regex doesn't phase me (but I've seen other programmers scratch their heads at some more uncommon expressions).
Being able to reverse a route via some identifier (in Django's case by route's name) is a must. Hardcoding urls in templates or controllers (view in Django) is a big no-no. Django has a template tag that uses the reverse() method
The one thing I wish I could do is have the concept of default routes in django (like Rails does or even Pylons). In Django every route has to map to a view method, there is no concept of trying to call a certain view based on the URL itself. The benefit is that there are no surprises - your urls.py is the Table of Contents for your project or app. The disadvantage is that urls.py tend to be longer.

'WebControls' for Ruby on Rails

I've recently started working with RoR for some projects and I quite like the framework - however coming from an ASP.NET background I'm quite fond of the idea of being able to purchase & drop in reusable components/control such as those from telerik, without having to 'reinvent'.
I suppose it would be possible to maybe create my own using partials or plugins or similar, but I'm wondering if there is anything out there already, or perhaps alternatives which could be massaged into place, like javascript widgets etc?
I don't know of any commercial components or "controls", but there's thousands (probably, I haven't counted them) of plugins out there freely available, to do a great many things for you, some of which would probably count as "controls". Unfortunately, there's no one place to go and find them, and the quality is depressingly variable, but there are a number of plugin indexes like http://agilewebdevelopment.com/plugins/ that might help in finding what you want while weeding out the dross.
Ext JS is a great GUI toolkit. I can't say that it entirely fits in with the RoR way of doing things, but if you write your controllers to return JSON it isn't too bad.
One of the big differences between Ruby/Rails and the .Net world is the fact that most of the available plugins are open-source and integrate at the code level. There is an incredible array of plugins for Rails, and it is very straight forward to write your own. Due to the nature of Ruby you can hook into any just about any part of the language and framework, giving you impressive extensibility.
I am not sure how Web Controls work, but it sounds like they are a "black-box" that provides an end-to-end solution for both UI and data-level operations ... ?
Many of the Rails plugins do provide both UI and data aspects. An example would be "restful_authentication" which provides you with both some basic forms for login and user registration as well as an authentication module and a Active-Record model. Again, this operates at a code-level, so will actually push the relevant code into your codebase when you install and "generate" the authentication modules.
As for "widgets", there is no equivalent in Rails, per-se, but there are a number of JavaScript libraries that provide similar functionality. I use and recommend jQuery UI, myself.
Dojo has a widget library which might meet your needs.

Resources