Configuring Notepad++ for ruby on rails - ruby-on-rails

I'm a newbie to ruby on rails and programming in general. I would like to use notepad++.
I have it installed but I can't figure out how to enable syntax highlighting. I have searched through Google but I've only found how to fix erb files (Apparently there is an error with these file type).
Any help would be appreciated.

Go into Settings > Style Configurator and select your language (Ruby):
In the box labelled "User ext." in the bottom-left-hand corner, add the extensions that you'd like to be highlighted as Ruby, separated by a space. Then just Save & Close.

If you go to the "language" tab, go down to 'R' and then go to "Ruby" this will also enable syntax highlighting but only for the duration of your session.

Related

Does every ruby on rails app need to be written on the console terminal?

I don't like using the console terminal. Is it possible to use a text editor like bracket *(MY FAVORITE) to write ruby code? I've seen ruby files. Are those written on an editor? Or is it the case that all these schools teach you the basics through the console and later you can write code on an editor?
Ruby do not have to be written in the terminal.
I myself do most of my coding in sublime and do run some commands in the terminal to run tests and generate some files. (Rails generators are quite awesome by the way)
I have a colleague who uses Ruby mine and from what I understand you can use that to do rails development without using the console.
Yes obviously you can use text editors.
You can write code in editor save it as file_name.rb and run from console as ruby file_name.rb
And this is just a start with Ruby. Just give your 20 minutes and you will get to know
https://www.ruby-lang.org/en/documentation/quickstart/
When you will get familiar with all the great things about ruby
You can start with Rails, as it's name suggests it actually get you started
http://guides.rubyonrails.org/getting_started.html
Just go on and you get fell in love with Ruby on Rails what it is called.
It's a lot convenient to use text editors and write codes instead of giving yourself a hard time coding using the console.
Sublime Text is one of the widely used editors, very easy to use and free. I've always used this.
You could also check out some of the best editors here 5 Best editors - Lifehacker
You can use any text editor and save the codes with the .rb extension <file-name>.rb and run it through terminal like this: ruby filename.rb

IntelliJ Ruby syntax highlighting

I am having some issues with getting IntelliJ to properly recognize my Ruby / Rails application syntax.
Screenshot here:
http://www.evernote.com/shard/s5/sh/4a3072c9-0439-4d31-aa16-85796d1a011a/ed4017710a5dcf700396c751011dae74
I have the Ruby plugin installed. I also have the Rails gem and other gems installed, but no go.
Any idaes?
(The question was posted a while ago but I want to make #mattalxndr's wish come true :-) )
This looks like an issue with the Hash notation and not color highlighting.
The wiggly red line indicates that IntelliJ is not recognizing the {symbol: "value"} syntax. In contrast, {:jobs => #jobs} is valid on the same line.
This syntax was introduced in Ruby 1.9.
Solution: Go to the SDK tab in the Project Structure window and make sure that you are using ruby 1.9 or higher.
BTW, you can switch between the two notations by placing the cursor on the symbol and invoking the "Show intention action" function (in OSX the keys are ⎇⏎).

How to set up Ruby / RoR methods autocomplete with sublimecodeintel in Sublime Text 3?

Goal: Using sublimecodeintel + ctags, have Sublime text 3 autocomplete show available methods for each class.
Example: typing "[1,2,3]." should give options like
to_s
.to_a
.to_ary
.empty?
I have searched extensively on the topic for the past couple of days. the idea is to make sublime text aware of the RVM-Ruby being used for the project and have autocomplete prompt the available methods.
This isn't a sublime text 3 (build 3047, osx mavericks), sublimecodeintel or ctags issue.
Sublimecodeintel is verified working - it autocompletes for classes defined in project.
ctags have been installed using brew. and the built up tags file contains tags from across the project. Its more of a correct set of settings / order of installing the plugins to get it working.
Any help would be much appreciated!
I think that you want this: go in View -> Syntax -> Rails
for the use highlights CTRL+SPACE

Any TextMate trick/bundle to lookup Rails documentation?

I know this is common in 'full featured' IDE's and not text editors but TextMate walks a unique line with its many bundles... I'm wondering if there is an easy way to, say, click on a Ruby or Rails class or method and have TextMate (or shell) take me to the definition or some documentation?
There's one built into the rails bundle (^h) which uses api dock.
Another pretty nice way of doing it is using the rails os x dictionary, but it has a few downsides and I'm not sure what version of rails it's using (I'm pretty sure it's not rails 3, but I haven't checked).
Ctrl-H is an excellent option to learn about Ruby or Rails API.
But this doesn't work for any other methods or class that may be defined or included in your project. For those I've written a TextMate Bundle command (you can easily assign it to Ctrl+] for example) that lookup for the definition of the class or method under the caret and displays it in a tooltip, along with the file name and the line where it was find.
Check it out: Add a shortcut to TextMate to lookup a class or method definition in a tooltip
Hope you'll find it useful ;)

Textmate Ruby on Rails Highlighting

I have Textmate 1.5.7 running on my leopard machine.
When programming in rails, for some reason some key words do not get highlighted.
For example: validates_presence_of, has_many, remote_form_for (form_for gets highlighted) etc...
I tried switching themes and it did not help. I also tried upgrading to the most recent rails bundle but no cigar. Could someone please help?
Use RubyOnRails as your language rather than Ruby
If you're editing views like .erb files you'll want to select HTML (Rails) so the remote_form_for, etc. get properly highlighted. For everything else (controllers, models, migrations, etc.) like #Omar points out, make sure you've got Ruby on Rails selected.
Just a quick note for other lurkers -- it took me a little while to figure out how to change languages on TextMate. You can do it through the Bundle Editor, which will show you the shortcut as well...

Resources